DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30855>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30855

[lang] Additional constructor for EqualsBuilder and isEquals member access.





------- Additional Comments From [EMAIL PROTECTED]  2004-10-20 23:27 -------
I agree with Gary.  Again, this is a simple addition.  Also, the client 
currently does not only have to write:

 if (this == other) {
   return true;
 }
 return new EqualsBuilder().append(.......


in fact, they have to write:

if (comparisonObject == thisObject)
{
        return true;
}
else if ((comparisonObject == null) ||
        (comparisonObject.getClass() != thisObject.getClass())
{
        return false;
}

return new EqualsBuilder().append(.......

This leaves a lot of room for error, and it's definitely required code for 
properly implementing equals().  As mentioned earlier, doing the previously 
recommended "instanceof" comparison is incorrect, but unfortunately, most 
developers continue to use this technique.  By providing this alternative 
implementation, you would eliminate such errors.

Regards,
Ari

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to