Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.2
-
None
-
None
-
all
Description
Is it really correct to compare references and not values in following places? Note that this are mostly either String or Long or Integer.
I'm sure there are more. I guess that all these kinds of 'equals' should not compare reference but value.
e.g. JCRHeader.java, compares references instead values.
...
private String fieldName;
private String value;
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final JCRHeader other = (JCRHeader) obj;
if (getValue() != other.getValue() || getFieldName() != other.getFieldName())
return false;
return true;
}