[cdi-dev] [JBoss JIRA] (CDI-670) Clarify InterceptionFactory.ignoreFinalMethods() purpose and functioning

Martin Kouba (JIRA) issues at jboss.org
Thu Dec 15 03:44:00 EST 2016

Martin Kouba created CDI-670:

             Summary: Clarify InterceptionFactory.ignoreFinalMethods() purpose and functioning
                 Key: CDI-670
                 URL: https://issues.jboss.org/browse/CDI-670
             Project: CDI Specification Issues
          Issue Type: Clarification
            Reporter: Martin Kouba
             Fix For: 2.0 .Final

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):

 Foo myFoo;

 @RequestScoped // -> Requires a client proxy
 public Foo produce(InterceptionFactory<Foo> interceptionFactory) {
        // Suppose Foo has a final method
        return interceptionFactory.ignoreFinalMethods().createInterceptedInstance(new FinalProduct());

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*.

This message was sent by Atlassian JIRA

More information about the cdi-dev mailing list