Skip to content

Commit

Permalink
Fix InternalAttribute.equals
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
windie authored and normanmaurer committed Jan 11, 2016
1 parent 6fe0db4 commit 9ae155d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ public int hashCode() {

@Override
public boolean equals(Object o) {
if (!(o instanceof Attribute)) {
if (!(o instanceof InternalAttribute)) {
return false;
}
Attribute attribute = (Attribute) o;
InternalAttribute attribute = (InternalAttribute) o;
return getName().equalsIgnoreCase(attribute.getName());
}

Expand Down

0 comments on commit 9ae155d

Please sign in to comment.