diff --git a/src/main/java/io/leangen/geantyref/AnnotatedArrayTypeImpl.java b/src/main/java/io/leangen/geantyref/AnnotatedArrayTypeImpl.java index 48122f5..a487745 100644 --- a/src/main/java/io/leangen/geantyref/AnnotatedArrayTypeImpl.java +++ b/src/main/java/io/leangen/geantyref/AnnotatedArrayTypeImpl.java @@ -32,6 +32,6 @@ public boolean equals(Object other) { @Override public int hashCode() { - return super.hashCode() + componentType.hashCode(); + return super.hashCode() ^ componentType.hashCode(); } } diff --git a/src/main/java/io/leangen/geantyref/AnnotatedCaptureTypeImpl.java b/src/main/java/io/leangen/geantyref/AnnotatedCaptureTypeImpl.java index 133ce24..ff1d297 100644 --- a/src/main/java/io/leangen/geantyref/AnnotatedCaptureTypeImpl.java +++ b/src/main/java/io/leangen/geantyref/AnnotatedCaptureTypeImpl.java @@ -134,7 +134,7 @@ public AnnotatedWildcardType getAnnotatedWildcardType() { @Override public int hashCode() { - return wildcard.hashCode() + variable.hashCode(); + return wildcard.hashCode() ^ variable.hashCode(); } @Override diff --git a/src/main/java/io/leangen/geantyref/AnnotatedParameterizedTypeImpl.java b/src/main/java/io/leangen/geantyref/AnnotatedParameterizedTypeImpl.java index e123804..d1e0188 100644 --- a/src/main/java/io/leangen/geantyref/AnnotatedParameterizedTypeImpl.java +++ b/src/main/java/io/leangen/geantyref/AnnotatedParameterizedTypeImpl.java @@ -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); } } diff --git a/src/main/java/io/leangen/geantyref/AnnotatedTypeImpl.java b/src/main/java/io/leangen/geantyref/AnnotatedTypeImpl.java index a48ef47..748e77a 100644 --- a/src/main/java/io/leangen/geantyref/AnnotatedTypeImpl.java +++ b/src/main/java/io/leangen/geantyref/AnnotatedTypeImpl.java @@ -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())); } } diff --git a/src/main/java/io/leangen/geantyref/AnnotatedTypeVariableImpl.java b/src/main/java/io/leangen/geantyref/AnnotatedTypeVariableImpl.java index babe1e1..b9e2cc5 100644 --- a/src/main/java/io/leangen/geantyref/AnnotatedTypeVariableImpl.java +++ b/src/main/java/io/leangen/geantyref/AnnotatedTypeVariableImpl.java @@ -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); } } diff --git a/src/main/java/io/leangen/geantyref/AnnotatedWildcardTypeImpl.java b/src/main/java/io/leangen/geantyref/AnnotatedWildcardTypeImpl.java index 5a19cd4..ce6ff69 100644 --- a/src/main/java/io/leangen/geantyref/AnnotatedWildcardTypeImpl.java +++ b/src/main/java/io/leangen/geantyref/AnnotatedWildcardTypeImpl.java @@ -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); } }