mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8274299: Make Method/Constructor/Field accessors @Stable
Reviewed-by: redestad, mchung
This commit is contained in:
parent
1459180f35
commit
7ad74d82d7
13 changed files with 748 additions and 85 deletions
|
@ -85,7 +85,8 @@ public final class Method extends Executable {
|
|||
private byte[] annotations;
|
||||
private byte[] parameterAnnotations;
|
||||
private byte[] annotationDefault;
|
||||
private volatile MethodAccessor methodAccessor;
|
||||
@Stable
|
||||
private MethodAccessor methodAccessor;
|
||||
// For sharing of MethodAccessors. This branching structure is
|
||||
// currently only two levels deep (i.e., one root Method and
|
||||
// potentially many Method objects pointing to it.)
|
||||
|
@ -665,8 +666,8 @@ public final class Method extends Executable {
|
|||
private MethodAccessor acquireMethodAccessor() {
|
||||
// First check to see if one has been created yet, and take it
|
||||
// if so
|
||||
MethodAccessor tmp = null;
|
||||
if (root != null) tmp = root.getMethodAccessor();
|
||||
Method root = this.root;
|
||||
MethodAccessor tmp = root == null ? null : root.getMethodAccessor();
|
||||
if (tmp != null) {
|
||||
methodAccessor = tmp;
|
||||
} else {
|
||||
|
@ -689,6 +690,7 @@ public final class Method extends Executable {
|
|||
void setMethodAccessor(MethodAccessor accessor) {
|
||||
methodAccessor = accessor;
|
||||
// Propagate up
|
||||
Method root = this.root;
|
||||
if (root != null) {
|
||||
root.setMethodAccessor(accessor);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue