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 additional constructor for EqualsBuilder Summary: additional constructor for EqualsBuilder Product: Commons Version: 2.0 Final Platform: All OS/Version: All Status: NEW Severity: Enhancement Priority: Other Component: Lang AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Hi, I think it would be helpful to provide another constructor (and corresponding boolean member for initial append() checks) for EqualsBuilder as follows: /* * New flag to indicate no need to proceed further * An initial check at the beginning of the append() methods could force an immediate return */ protected boolean isDone = false; ... ... public EqualsBuilder(Object thisObject, Object comparisonObject) { this(); if (comparisonObject == thisObject) { isDone = true; } else if ((comparisonObject == null) || (comparisonObject.getClass() != thisObject.getClass()) { isEquals = false; } } This would mitigate the need to do subsequent field-by-field checking. Note that this also eliminates the "instanceof" symmetric problem described in the JavaWorld article by Alex Blewitt: http://www.javaworld.com/javaworld/jw-06-2004/jw-0614-equals_p.html Also, based on this article, I would recommend fixing the JavaDoc example to NOT use instanceof. Finally, can they change the member "isEquals" from private to protected? At present, I cannot subclass EqualsBuilder and use this member. Thank you, Ari --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
