This commit is contained in:
Gary Gregory 2020-04-20 16:43:58 -04:00
commit c25de73d21
2 changed files with 2 additions and 5 deletions

View File

@ -207,8 +207,7 @@ public R getValue() {
@Override
public int hashCode() {
// see Map.Entry API specification
return (getKey() == null ? 0 : getKey().hashCode()) ^
(getValue() == null ? 0 : getValue().hashCode());
return Objects.hashCode(getKey()) ^ Objects.hashCode(getValue());
}
/**

View File

@ -171,9 +171,7 @@ public boolean equals(final Object obj) {
*/
@Override
public int hashCode() {
return (getLeft() == null ? 0 : getLeft().hashCode()) ^
(getMiddle() == null ? 0 : getMiddle().hashCode()) ^
(getRight() == null ? 0 : getRight().hashCode());
return Objects.hashCode(getLeft()) ^ Objects.hashCode(getMiddle()) ^ Objects.hashCode(getRight());
}
/**