[cdi-dev] Problem with JDK8 u60 and synthesized methods for lambdas now exposing annotations
antoine at sabot-durand.net
Wed Aug 26 12:13:15 EDT 2015
I'm not sure that we should state that in the spec. The fact that the
compiler generates a synthetic method for the lambda is a java
implementation choice. Our implementation should only consider code written
by user not the one generated by the compiler. Wdyt Jozef ?
Le mer. 26 août 2015 à 16:56, arjan tijms <arjan.tijms at gmail.com> a écrit :
> We just discovered an issue where using a lambda in an observer method
> results in a synthesized method for that lambda that since u60 makes
> the @Observes annotation visible. This will cause CDI (Weld
> 2.2.2.Final in this case as shipped with GlassFish 4.1) to see this
> generated method as an actual observer method.
> See the following mail on the OpenJDK list for details:
> The suggestion there is that it's simply a bug in the CDI implementation.
> I wonder, should the CDI spec in general say that synthesized methods
> should be ignored when scanning for observer (and possible other)
> methods? I briefly scanned through the spec but didn't see any
> references to synthesized methods.
> Kind regards,
> Arjan Tijms
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> Note that for all code provided on this list, the provider licenses the
> code under the Apache License, Version 2 (
> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other
> intellectual property rights inherent in such information.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cdi-dev