8141677: Improve java.lang.invoke.MemberName hashCode implementation

Reviewed-by: vlivanov, psandoz, shade
This commit is contained in:
Claes Redestad 2015-11-09 17:14:05 +01:00
parent fe2786af5f
commit 8e73a2915d

View File

@ -694,8 +694,11 @@ import java.util.Objects;
@Override
public int hashCode() {
return Objects.hash(clazz, getReferenceKind(), name, getType());
// Avoid autoboxing getReferenceKind(), since this is used early and will force
// early initialization of Byte$ByteCache
return Objects.hash(clazz, new Byte(getReferenceKind()), name, getType());
}
@Override
public boolean equals(Object that) {
return (that instanceof MemberName && this.equals((MemberName)that));