< prev index next >
src/java.base/share/classes/java/lang/invoke/MemberName.java
Print this page
rev 13019 : 8141677: Improve java.lang.invoke.MemberName hashCode implementation
Reviewed-by: TBD
*** 692,703 ****
return res;
}
@Override
public int hashCode() {
! return Objects.hash(clazz, getReferenceKind(), name, getType());
}
@Override
public boolean equals(Object that) {
return (that instanceof MemberName && this.equals((MemberName)that));
}
--- 692,709 ----
return res;
}
@Override
public int hashCode() {
! int hash = 1;
! hash = 31 * hash + Objects.hashCode(this.clazz);
! hash = 31 * hash + Byte.hashCode(getReferenceKind());
! hash = 31 * hash + Objects.hashCode(this.name);
! hash = 31 * hash + Objects.hashCode(getType());
! return hash;
}
+
@Override
public boolean equals(Object that) {
return (that instanceof MemberName && this.equals((MemberName)that));
}
< prev index next >