You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/06/12 15:55:41 UTC
DO NOT REPLY [Bug 20707] New: -
LabelValueBean does not have equals/hashCode methods
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: struts-dev@jakarta.apache.org
ReportedBy: ericpabst@discoverfinancial.com
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: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org