<div dir="ltr">I&#39;d be concerned if we introduced text explicitly calling out code written by the developer instead of generated by the compiler.  What if I&#39;m using an annotation processor that generated implementations for CDI beans? Those would get ignored.<div><br></div><div>Better to say something along the lines of synthesized methods are not typically visible, therefore shouldn&#39;t be scanned.</div><div><br></div><div>John<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 26, 2015 at 12:14 PM Antoine Sabot-Durand &lt;<a href="mailto:antoine@sabot-durand.net">antoine@sabot-durand.net</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Arjan,<div><br></div><div>I&#39;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 ?</div></div><div dir="ltr"><div><br></div><div>Antoine</div></div><br><div class="gmail_quote"><div dir="ltr">Le mer. 26 août 2015 à 16:56, arjan tijms &lt;<a href="mailto:arjan.tijms@gmail.com" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=arjan.tijms@gmail.com&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">arjan.tijms@gmail.com</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
We just discovered an issue where using a lambda in an observer method<br>
results in a synthesized method for that lambda that since u60 makes<br>
the @Observes annotation visible. This will cause CDI (Weld<br>
2.2.2.Final in this case as shipped with GlassFish 4.1) to see this<br>
generated method as an actual observer method.<br>
<br>
See the following mail on the OpenJDK list for details:<br>
<br>
<a href="http://mail.openjdk.java.net/pipermail/lambda-dev/2015-August/012146.html/012146.html" rel="noreferrer" target="_blank">http://mail.openjdk.java.net/pipermail/lambda-dev/2015-August/012146.html/012146.html</a><br>
<br>
The suggestion there is that it&#39;s simply a bug in the CDI implementation.<br>
<br>
I wonder, should the CDI spec in general say that synthesized methods<br>
should be ignored when scanning for observer (and possible other)<br>
methods? I briefly scanned through the spec but didn&#39;t see any<br>
references to synthesized methods.<br>
<br>
Kind regards,<br>
Arjan Tijms<br>
_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
</blockquote></div>
_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.</blockquote></div></div></div>