Skip to content

Commit

Permalink
Normalizing hashCode implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bojan Tomic committed Nov 2, 2016
1 parent 9b58a47 commit 517307c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public boolean equals(Object other) {

@Override
public int hashCode() {
return super.hashCode() + componentType.hashCode();
return super.hashCode() ^ componentType.hashCode();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public AnnotatedWildcardType getAnnotatedWildcardType() {

@Override
public int hashCode() {
return wildcard.hashCode() + variable.hashCode();
return wildcard.hashCode() ^ variable.hashCode();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public boolean equals(Object other) {

@Override
public int hashCode() {
return super.hashCode() + Arrays.hashCode(typeArguments);
return super.hashCode() ^ Arrays.hashCode(typeArguments);
}
}
2 changes: 1 addition & 1 deletion src/main/java/io/leangen/geantyref/AnnotatedTypeImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ public boolean equals(Object other) {

@Override
public int hashCode() {
return 31 * (this.getType().hashCode() + Arrays.hashCode(this.getAnnotations()));
return 31 * (this.getType().hashCode() ^ Arrays.hashCode(this.getAnnotations()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public boolean equals(Object other) {

@Override
public int hashCode() {
return super.hashCode() + Arrays.hashCode(annotatedBounds);
return super.hashCode() ^ Arrays.hashCode(annotatedBounds);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ public boolean equals(Object other) {

@Override
public int hashCode() {
return super.hashCode() + Arrays.hashCode(lowerBounds) + Arrays.hashCode(upperBounds);
return super.hashCode() ^ Arrays.hashCode(lowerBounds) ^ Arrays.hashCode(upperBounds);
}
}

0 comments on commit 517307c

Please sign in to comment.