<div dir="ltr">Hi guys,<div><br></div><div>Re-reading materials and all our discussion on CDI-527, I think there&#39;s an option we didn&#39;t explore</div><div><br></div><div>Instead of introducing a new annotation, we could loose rules on proxied bean creation for class having final methods.<br></div><div>Today if you declare a class requiring a proxy (because of scope or AOP) you&#39;ll get an exception, so nobody declares a bean with such a feature since the app wouldn&#39;t deploy.</div><div>It&#39;s the same for producer: you won&#39;t declare an @ApplicationScoped producer for a type having final method since your app won&#39;t deploy.</div><div><br></div><div>So in today existing code, final method are in non cdi code or in cdi code that doesn&#39;t requires proxy (@Dependent without AOP)</div><div><br></div><div>If we decide to loose the rules in &quot;3.15 Unproxyable bean types&quot; [1] it won&#39;t have impact on existing code (unless I missed something), since you can&#39;t have proxied bean with final method without deployment error.</div><div>It would only allow new proxied bean with final method in it.<br></div><div><br></div><div>Change should also be made in &quot;7.2. Container invocations and interception&quot; [2] to explicitly exclude final methods from the list of business method.</div><div><br></div><div>This change could be seen as not backward compatible, but since current code cannot have proxied bean with final class it doesn&#39;t change existing behavior but allow new usage.</div><div>It also allow code with producer for class of the JDK introducing final in their code to continue working seamlessly in CDI 2.0.</div><div>Finally that prevent us to introduce specific annotation or configuration looking like a hack.</div><div><br></div><div>In the past we already introduce behavior changes when we changed the list of bean defining annotation in CDI 1.2 or when we loose usage of certain beanManager method in AfterBeanDiscovery event (I see this proposal very like this last example).</div><div><br></div><div>Wdyt ?</div><div><br></div><div>Antoine</div><div><br></div><div><br></div><div>[1] <a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#unproxyable">http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#unproxyable</a></div><div>[2] <a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#biz_method">http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#biz_method</a><br></div></div>