<font size=2 face="sans-serif">Hi Martin,</font><br><br><font size=2 face="sans-serif">For some reason, a proxied bean's equals
cannot be called. Are you aware of this problem? Although the spec says:</font><br><br><font size=2 face="Arial">The behavior of all methods declared by </font><tt><font size=1>java.lang.Object</font></tt><font size=2 face="Arial">,
except for </font><tt><font size=1>toString()</font></tt><font size=2 face="Arial">,
is</font><br><font size=2 face="Arial">undefined for a client proxy. Portable applications
should not invoke any method declared by</font><br><tt><font size=1>java.lang.Object</font></tt><font size=2 face="Arial">,
except for </font><tt><font size=1>toString()</font></tt><font size=2 face="Arial">,
on a client proxy.</font><br><br><font size=2 face="sans-serif">I thought the overridden equals is different
from the methods defined by Object class and it should be invoked.</font><br><br><font size=2 face="sans-serif">Please find attached a very simple test
case that shows a .equals() method not being invoked on a bean proxied
by Weld. </font><br><br><br><font size=2 face="sans-serif">In a debugger one can see that GenericBean.equals()
is not invoked within the Servlet:</font><br><br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; protected
void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {</font><br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; PrintWriter pw = response.getWriter();</font><br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; pw.println (&quot;Hello&quot;);</font><br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; if (gb.equals(new GenericBean(10))) { &nbsp;
&nbsp;// GenericBean.equals() is not invoked; test prints 'fail'</font><br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pw.println(&quot;pass&quot;);</font><br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; } else { </font><br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pw.println
(&quot;fail&quot;);</font><br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; }</font><br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; }</font><br><br><font size=2 face="sans-serif">The .war contains source and object
code. As you can see there's only two classes. <br></font><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>Unless stated otherwise above:<BR>
IBM United Kingdom Limited - Registered in England and Wales with number 741598. <BR>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU<BR>
<BR>