-
Clarification
-
Resolution: Obsolete
-
Major
-
None
-
1.2.Final
-
None
The interceptors spec only states (2.2 Interceptor Life Cycle):
If the InvocationContext.proceed method is not invoked by an interceptor method, the target instance will not be created.
But it's not clear what does it mean in the context of CDI.
Possible interpretations are:
- Contextual.create() returns null
- an exception (e.g. javax.enterprise.inject.CreationException) is thrown
I think the exception is more appropriate. Note that right now only @Dependent producer methods are allowed to return a null value.
By the way, the RI (Weld) currently returns null for beans which have no other interceptors associated and throws NPE for beans which also have other interceptor types associated. Also there is a TCK test which tests the "null" interpretation for a bean with only AroundConstruct interceptors. I'm going to create a separate TCK issue so that the test is redesigned.
- is related to
-
CDITCK-517 Do not expect Contextual.create() to return null if one of the interceptors in the AroundConstruct chain does not invoke InvocationContext.proceed()
- Resolved