Currently the docs say this.... 5.4.2.<br><br><div>•Behavior of all methods declared by java.lang.Object, except for toString(), is undefined for a client proxy<br>•Portable applications should not invoke any method declared by java.lang.Object, except for toString(), on a client proxy<div>
<br></div><div>I so don&#39;t agree with what is in the spec. now on this subject.</div><div>(Realizing that it is a work in progress...)</div><div><br></div><div>I think we should change this and call the underlying implementation for these methods.</div>
<div><br></div><div>Also equals and hashCode should work by unpacking and comparing the contextual instance.</div><div><br></div><div>Off topic....</div><div><br></div><div>It would be nice if there was a utility API that implementations had to implement that had these methods</div>
<div><br></div><div><br></div><div>isProxy (lets you know if an object is a client proxy)</div><div>getUnproxiedVersion (gives you the underlying unproxied version of the object)</div><div><br></div><div><br></div><div>(It may exist already.)</div>
<div><br></div><div><br><div><div class="gmail_quote">On Tue, Oct 18, 2011 at 10:17 AM, Mark Struberg <span dir="ltr">&lt;<a href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi folks!<br>
<br>
There is a problem still in the chain which is a bit more trickier. It&#39;s about equals() on contextual references.<br>
<br>
If the &#39;other&#39; instance which gets compared with is a proxy as well, then we would first need to &#39;unpack&#39; it and pass the underlying contextual instance into the comparison implementation. Otherwise accessing private fields from the &#39;other&#39; will actually only hit the proxy, and not the &#39;real&#39; target.<br>

<br>
But otherwise it should work fine.<br>
<br>
<br>
Wdyt?<br>
<br>
1.) Should we specify this?<br>
<br>
2.) What is the expected behaviour?<br>
<br>
3.) Do we like to specify equals() for beans at all?<br>
4.) Is there some established behaviour in other frameworks which heavily uses proxies?<br>
5.) Should we at least specify that &#39;non portable behaviour results&#39;?<br>
<br>
<br>
LieGrue,<br>
strub<br>
<br>
<br>
<br>
----- Original Message -----<br>
&gt; From: Pete Muir &lt;<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>&gt;<br>
&gt; To: Mark Struberg &lt;<a href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>&gt;<br>
&gt; Cc: <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a>; Stuart Douglas &lt;<a href="mailto:sdouglas@redhat.com">sdouglas@redhat.com</a>&gt;<br>
&gt; Sent: Monday, March 14, 2011 12:52 PM<br>
&gt; Subject: Re: [cdi-dev] calling &#39;equals&#39; on a proxy?<br>
&gt;<br>
&gt; Stuart, you had this one worked out right? I believe the spec says the behaviour<br>
&gt; is unspecified.<br>
&gt;<br>
&gt; On 7 Mar 2011, at 15:52, Mark Struberg wrote:<br>
&gt;<br>
&gt;&gt;  Hi Pete, others!<br>
&gt;&gt;<br>
&gt;&gt;  Do you remember our discussion about what should happen if equals() gets<br>
&gt; called on a proxy?<br>
&gt;&gt;<br>
&gt;&gt;  Should it route to the equals method of the currently proxied instance?<br>
&gt;&gt;<br>
&gt;&gt;  LieGrue,<br>
&gt;&gt;  strub<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;  _______________________________________________<br>
&gt;&gt;  cdi-dev mailing list<br>
&gt;&gt;  <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;  <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt;<br>
<br>
<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>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><b>Rick Hightower</b><br>(415) 968-9037 <br><a href="http://www.google.com/profiles/RichardHightower" target="_blank">Profile</a> <br><br>
</div></div></div>