Skip to content

Commit

Permalink
#2027 User Equality
Browse files Browse the repository at this point in the history
Several collections use user equality and would lose their integrity if
equality was based on name (such as the hit maker or groups part of
users)
  • Loading branch information
originalname51 committed Mar 4, 2021
1 parent 87bf669 commit 7dd3d58
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void setArchived(boolean archived) {

@Override
public int hashCode() {
return Objects.hash(this.userId.toUpperCase(), this.password, this.firstName, this.lastName, this.active);
return Objects.hash(this.userId.toUpperCase());
}

@Override
Expand All @@ -245,10 +245,7 @@ public boolean equals(Object target) {

User dataTarget = ((User) target);

return new EqualsBuilder().append(this.userId.toUpperCase(), dataTarget.getUserId().toUpperCase())
.append(this.firstName, dataTarget.getFirstName()).append(this.lastName, dataTarget.getLastName())
.append(this.password, dataTarget.getPassword()).append(this.active, dataTarget.getActive())
.append(this.roles, dataTarget.getRoles()).isEquals();
return new EqualsBuilder().append(this.userId.toUpperCase(), dataTarget.getUserId().toUpperCase()).isEquals();
}

@Override
Expand Down

0 comments on commit 7dd3d58

Please sign in to comment.