Skip to content

Commit

Permalink
[private-bamoe-issues#1326] Simplify the equals/hashCode methods
Browse files Browse the repository at this point in the history
  • Loading branch information
martinweiler committed Jan 3, 2024
1 parent e027acf commit 23d2adf
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,21 +374,16 @@ public String getUuid() {

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (this.getId() ^ (this.getId() >>> 32));
return result;
return (int)getId();
}

@Override
public boolean equals(Object obj) {
if ( this == obj ) return true;
if ( obj == null ) return false;
if ( getClass() != obj.getClass() ) return false;
final DefaultJobHandle other = (DefaultJobHandle) obj;
if (this.getId() != other.getId())
return false;
return true;
if (obj == null || !obj.getClass().equals(getClass())) {
return false;
}
return getId() == ((DefaultJobHandle)obj).getId();
}

}
Expand Down

0 comments on commit 23d2adf

Please sign in to comment.