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

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20707

LabelValueBean does not have equals/hashCode methods

           Summary: LabelValueBean does not have equals/hashCode methods
           Product: Struts
           Version: 1.1 Beta 1
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Custom Tags
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


LabelValueBean does not have equals/hashCode methods which are useful for 
seeing if an LabelValueBean is contained in a Collection, etc.  I think that 
the equals/hashCode should just use the value.  

I'm not in a position to do a patch, but it would be like this:

public boolean equals(Object other) {
    if (other instanceof LabelValueBean) {
        if (getValue() != null) {
            return getValue().equals((LabelValueBean) other).getValue());
        } else {
            return super.equals(other);
        }
    } else {
        return false;
    }
}
        
public int hashCode() {
    if (getValue() != null) {
        return getValue().hashCode();
    } else {
        return super.hashCode();
    }
}

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

Reply via email to