8291065: Creating a VarHandle for a static field triggers class initialization

Reviewed-by: mchung, psandoz
This commit is contained in:
Chen Liang 2023-07-18 00:58:25 +00:00 committed by Mandy Chung
parent a53345ad03
commit 201e3bcf52
10 changed files with 744 additions and 160 deletions

View file

@ -4201,7 +4201,7 @@ return mh1;
}
refc = lookupClass();
}
return VarHandles.makeFieldHandle(getField, refc, getField.getFieldType(),
return VarHandles.makeFieldHandle(getField, refc,
this.allowedModes == TRUSTED && !getField.isTrustedFinalField());
}
/** Check access and get the requested constructor. */