mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
Merge
This commit is contained in:
commit
528bc73ca4
51 changed files with 355 additions and 233 deletions
|
@ -3419,8 +3419,8 @@ public final class Class<T> implements java.io.Serializable,
|
|||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getName() + "." + name + "(");
|
||||
if (argTypes != null) {
|
||||
Stream.of(argTypes).map(c -> {return (c == null) ? "null" : c.getName();}).
|
||||
collect(Collectors.joining(","));
|
||||
sb.append(Stream.of(argTypes).map(c -> {return (c == null) ? "null" : c.getName();}).
|
||||
collect(Collectors.joining(",")));
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
|
@ -1864,35 +1864,6 @@ public abstract class VarHandle implements Constable {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare this {@linkplain VarHandle} with another object for equality.
|
||||
* Two {@linkplain VarHandle}s are considered equal if they both describe the
|
||||
* same instance field, both describe the same static field, both describe
|
||||
* array elements for arrays with the same component type, or both describe
|
||||
* the same component of an off-heap structure.
|
||||
*
|
||||
* @param o the other object
|
||||
* @return Whether this {@linkplain VarHandle} is equal to the other object
|
||||
*/
|
||||
@Override
|
||||
public final boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
VarHandle that = (VarHandle) o;
|
||||
return accessModeType(AccessMode.GET).equals(that.accessModeType(AccessMode.GET)) &&
|
||||
internalEquals(that);
|
||||
}
|
||||
|
||||
abstract boolean internalEquals(VarHandle vh);
|
||||
|
||||
@Override
|
||||
public final int hashCode() {
|
||||
return 31 * accessModeType(AccessMode.GET).hashCode() + internalHashCode();
|
||||
}
|
||||
|
||||
abstract int internalHashCode();
|
||||
|
||||
/**
|
||||
* Returns a compact textual description of this {@linkplain VarHandle},
|
||||
* including the type of variable described, and a description of its coordinates.
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
@ -67,17 +67,6 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase {
|
|||
super(form);
|
||||
this.be = be;
|
||||
}
|
||||
|
||||
@Override
|
||||
final boolean internalEquals(VarHandle vh) {
|
||||
ByteArrayViewVarHandle that = (ByteArrayViewVarHandle) vh;
|
||||
return be == that.be;
|
||||
}
|
||||
|
||||
@Override
|
||||
final int internalHashCode() {
|
||||
return Boolean.hashCode(be);
|
||||
}
|
||||
}
|
||||
|
||||
static final class ArrayHandle extends ByteArrayViewVarHandle {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue