Skip to content

Commit

Permalink
Normalize equals() implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Sep 27, 2023
1 parent 37c292f commit 8b9c16e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/main/java/org/apache/commons/validator/util/Flags.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,14 @@ public Object clone() {
*/
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Flags)) {
return false;
}

if (obj == this) {
return true;
}

final Flags f = (Flags) obj;

return this.flags == f.flags;
Flags other = (Flags) obj;
return flags == other.flags;
}

/**
Expand Down

0 comments on commit 8b9c16e

Please sign in to comment.