<div dir="ltr"><div class="gmail_default" style="font-size:large">+1</div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-09 10:38 GMT+02:00 Antoine Sabot-Durand (JIRA) <span dir="ltr">&lt;<a href="mailto:issues@jboss.org" target="_blank">issues@jboss.org</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
    [ <a href="https://issues.jboss.org/browse/CDI-456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=13000169#comment-13000169" target="_blank">https://issues.jboss.org/browse/CDI-456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=13000169#comment-13000169</a> ]<br>
<br>
Antoine Sabot-Durand commented on CDI-456:<br>
------------------------------------------<br>
<span class=""><br>
We all know there are issues with the Java EE module architecture. This has to be fix at Java EE level and CDI spec will have to follow not the other way around.<br>
Now, regarding this ticket I think Jozef explained more than once why {{Bean#getBeanClass()}} should behave this way.  Yet I understand the need to get the exact type of a given bean instances. So IMO we should split this ticket in 2 :<br>
<br>
</span># Clarify the javadoc and spec description of {{Bean#getBeanClass()}} to avoid confusion<br>
# Add a new method to {{Bean}} returning the exact type of the bean instances. something like {{Bean#getInstanceClass()}}<br>
<span class="im HOEnZb"><br>
<br>
<br>
&gt; fix Bean#getBeanClass() definition<br>
&gt; ----------------------------------<br>
&gt;<br>
&gt;                 Key: CDI-456<br>
&gt;                 URL: <a href="https://issues.jboss.org/browse/CDI-456" target="_blank">https://issues.jboss.org/browse/CDI-456</a><br>
&gt;             Project: CDI Specification Issues<br>
&gt;          Issue Type: Bug<br>
&gt;          Components: Beans<br>
&gt;            Reporter: Mark Struberg<br>
&gt;<br>
&gt; currently Bean#getBeanClass() is defined to return the class of the bean it produces but has one important exception: in case of a producer method or field it must return the class of the owner bean of this method or field.<br>
&gt; Imo this only causes troubles and doesn&#39;t add any benefit.<br>
&gt; * At the time when &#39;using&#39; the Bean (create and destroy) we always ONLY need the type which is to be created.<br>
&gt; * At the time we create interceptors we ONLY need the type which is to be created;<br>
&gt; * At the time we create the normalscoping proxies we ONLY need the type which is to be created;<br>
&gt; In fact the only time we need the ownerBean is when scanning the methods and fields in it. And for creating we really need the owner-Bean and not it&#39;s bean-class!<br>
&gt; In OWB we worked around this by having our own method getReturnType() which consistently returns the type which gets created.<br>
<br>
<br>
<br>
--<br>
</span><span class="im HOEnZb">This message was sent by Atlassian JIRA<br>
</span><div class="HOEnZb"><div class="h5">(v6.3.1#6329)<br>
_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" 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" 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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><span style="font-family:arial;font-size:small"><b>Anatole Tresch</b></span><div style="font-family:arial;font-size:small">Java Lead Engineer, JSR Spec Lead<br>Glärnischweg 10<br>CH - 8620 Wetzikon</div><div style="font-family:arial;font-size:small"><br></div><div style="font-family:arial;font-size:small"><i>Switzerland, Europe Zurich, GMT+1</i></div><div style="font-family:arial;font-size:small"><i>Twitter:  @atsticks</i></div><div><i style="font-family:arial;font-size:small">Blogs: </i><font face="arial"><i><a href="http://javaremarkables.blogspot.ch/" target="_blank">http://javaremarkables.blogspot.ch/</a></i></font></div><div style="font-family:arial;font-size:small"><i>Google: atsticks<br>Mobile  +41-76 344 62 79</i></div></div>
</div>