Fix InternalAttribute.equals
Motivation: InternalAttribute doesn't extend Attribute, but its equals only returns true when it compares with an Attribute. So it will return false when comparing with itself. Modifications: Make sure InternalAttribute return false for non InternalAttribute objects. Result: InternalAttribute's equals works correctly.
This commit is contained in:
parent
6f8618889a
commit
1edf9eb94c
@ -79,10 +79,10 @@ final class InternalAttribute extends AbstractReferenceCounted implements Interf
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (!(o instanceof Attribute)) {
|
if (!(o instanceof InternalAttribute)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Attribute attribute = (Attribute) o;
|
InternalAttribute attribute = (InternalAttribute) o;
|
||||||
return getName().equalsIgnoreCase(attribute.getName());
|
return getName().equalsIgnoreCase(attribute.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user