<font size=2 face="sans-serif">Thank you Martin for the info! It is strange
that the application works on OWB</font><br><br><font size=2 face="sans-serif">Many thanks,<br>Emily<br>===========================<br>Emily Jiang<br>WebSphere Application Server, CDI Development Lead</font><br><font size=2 face="sans-serif">&nbsp;<br>MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN<br>Phone: &nbsp;+44 (0)1962 816278 &nbsp;Internal: 246278<br><br>Email: emijiang@uk.ibm.com <br>Lotus Notes: Emily Jiang/UK/IBM@IBMGB<br></font><br><br><br><br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Martin Kouba &lt;mkouba@redhat.com&gt;</font><br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Emily Jiang/UK/IBM@IBMGB,
</font><br><font size=1 color=#5f5f5f face="sans-serif">Cc: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Weld &lt;weld-dev@lists.jboss.org&gt;</font><br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">03/12/2015 08:27</font><br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Re: [weld-dev]
Overridden equals() are ignored on client proxy</font><br><font size=1 color=#5f5f5f face="sans-serif">Sent by: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">weld-dev-bounces@lists.jboss.org</font><br><hr noshade><br><br><br><tt><font size=2>Hi Emily,<br><br>yes, the spec is clear and for good reasons. This was already discussed
<br>in EG and weld community - see for example WELD-695 [1]. And the <br>consensus is: &quot;it does not make sense to delegate equals/hashcode
to <br>bean instances for client proxies&quot;.<br><br>One of the problems is that client proxies may be shared between <br>multiple injection points (and in Weld they are).<br><br>Also in Weld a client proxy is equal to a client proxy for the same bean.<br><br>Anyway, it seems it doesn't work on OWB either - see also OWB-458 [2].<br><br>Martin<br><br><br>[1]<br></font></tt><a href="https://issues.jboss.org/browse/WELD-695?focusedCommentId=12566720&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12566720"><tt><font size=2>https://issues.jboss.org/browse/WELD-695?focusedCommentId=12566720&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12566720</font></tt></a><tt><font size=2><br><br>[2]<br></font></tt><a href="https://issues.apache.org/jira/browse/OWB-458"><tt><font size=2>https://issues.apache.org/jira/browse/OWB-458</font></tt></a><tt><font size=2><br><br>Dne 3.12.2015 v 00:43 Emily Jiang napsal(a):<br>&gt; Hi Martin,<br>&gt;<br>&gt; For some reason, a proxied bean's equals cannot be called. Are you
aware<br>&gt; of this problem? Although the spec says:<br>&gt;<br>&gt; The behavior of all methods declared by java.lang.Object, except for<br>&gt; toString(), is<br>&gt; undefined for a client proxy. Portable applications should not invoke<br>&gt; any method declared by<br>&gt; java.lang.Object, except for toString(), on a client proxy.<br>&gt;<br>&gt; I thought the overridden equals is different from the methods defined
by<br>&gt; Object class and it should be invoked.<br>&gt;<br>&gt; Please find attached a very simple test case that shows a .equals()<br>&gt; method not being invoked on a bean proxied by Weld.<br>&gt;<br>&gt;<br>&gt; In a debugger one can see that GenericBean.equals() is not invoked<br>&gt; within the Servlet:<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;protected void doGet(HttpServletRequest
request,<br>&gt; HttpServletResponse response) throws ServletException, IOException
{<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;PrintWriter pw = response.getWriter();<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;pw.println (&quot;Hello&quot;);<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;if (gb.equals(new GenericBean(10))) { &nbsp;//
GenericBean.equals() is<br>&gt; not invoked; test prints 'fail'<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pw.println(&quot;pass&quot;);<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;} else {<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pw.println
(&quot;fail&quot;);<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&gt;<br>&gt; The .war contains source and object code. As you can see there's only<br>&gt; two classes.<br>&gt;<br>&gt; Many thanks,<br>&gt; Emily<br>&gt; ===========================<br>&gt; Emily Jiang<br>&gt; WebSphere Application Server, CDI Development Lead<br>&gt;<br>&gt; MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN<br>&gt; Phone: &nbsp;+44 (0)1962 816278 &nbsp;Internal: 246278<br>&gt;<br>&gt; Email: emijiang@uk.ibm.com<br>&gt; Lotus Notes: Emily Jiang/UK/IBM@IBMGB<br>&gt; Unless stated otherwise above:<br>&gt; IBM United Kingdom Limited - Registered in England and Wales with
number<br>&gt; 741598.<br>&gt; Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6 3AU<br>&gt;<br><br>-- <br>Martin Kouba<br>Software Engineer<br>Red Hat, Czech Republic<br>_______________________________________________<br>weld-dev mailing list<br>weld-dev@lists.jboss.org<br></font></tt><a href="https://lists.jboss.org/mailman/listinfo/weld-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/weld-dev</font></tt></a><tt><font size=2><br><br></font></tt><br><BR>