8215648: remove equals and hashCode implementations from j.l.i.VarHandle

Reviewed-by: mchung
This commit is contained in:
Vicente Romero 2019-01-11 09:02:44 -05:00
parent 8243e7f9fa
commit 0032475ef1
19 changed files with 19 additions and 126 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -63,17 +63,6 @@ final class VarHandle$Type$s {
return accessMode.at.accessModeType(receiverType, {#if[Object]?fieldType:$type$.class});
}
@Override
final boolean internalEquals(VarHandle vh) {
FieldInstanceReadOnly that = (FieldInstanceReadOnly) vh;
return fieldOffset == that.fieldOffset;
}
@Override
final int internalHashCode() {
return Long.hashCode(fieldOffset);
}
@Override
public Optional<VarHandleDesc> describeConstable() {
var receiverTypeRef = receiverType.describeConstable();
@ -349,17 +338,6 @@ final class VarHandle$Type$s {
#end[Object]
}
@Override
final boolean internalEquals(VarHandle vh) {
FieldStaticReadOnly that = (FieldStaticReadOnly) vh;
return base == that.base && fieldOffset == that.fieldOffset;
}
@Override
final int internalHashCode() {
return 31 * Long.hashCode(fieldOffset) + base.hashCode();
}
@Override
public Optional<VarHandleDesc> describeConstable() {
var fieldTypeRef = {#if[Object]?fieldType:$type$.class}.describeConstable();
@ -639,20 +617,6 @@ final class VarHandle$Type$s {
#end[Object]
}
@Override
final boolean internalEquals(VarHandle vh) {
// Equality of access mode types of AccessMode.GET is sufficient for
// equality checks
return true;
}
@Override
final int internalHashCode() {
// The hash code of the access mode types of AccessMode.GET is
// sufficient for hash code generation
return 0;
}
@Override
public Optional<VarHandleDesc> describeConstable() {
var arrayTypeRef = {#if[Object]?arrayType:$type$[].class}.describeConstable();