Details
-
Clarification
-
Resolution: Done
-
Critical
-
None
-
None
-
None
Description
It should be clear that InterceptionFactory.ignoreFinalMethods() only affects the generation of the "proxy" which enables interception. E.g. the following example would FAIL during validation of myFoo injection point (bootstrap):
@Inject Foo myFoo; @Produces @RequestScoped // -> Requires a client proxy public Foo produce(InterceptionFactory<Foo> interceptionFactory) { // Suppose Foo has a final method return interceptionFactory.ignoreFinalMethods().createInterceptedInstance(new Foo()); }
The reason is that the CDI container must treat the producer as a deployment problem (unless javax.enterprise.inject.spi.ProcessBeanAttributes.ignoreFinalMethods() is used for the producer method).
I understand that it's not very intuitive. On the other hand, these are two different concepts. I.e. the injection point validation happens during bootstrap while the InterceptionFactory is used at runtime.