mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-21 19:08:31 +00:00
8035788: Provide more consistency for lookups
Reviewed-by: jrose, vlivanov, ahgross
This commit is contained in:
parent
9aefc3174c
commit
33ccc261e0
@ -1505,6 +1505,10 @@ return mh1;
|
||||
// that is *not* the bytecode behavior.
|
||||
mods ^= Modifier.PROTECTED | Modifier.PUBLIC;
|
||||
}
|
||||
if (Modifier.isProtected(mods) && refKind == REF_newInvokeSpecial) {
|
||||
// cannot "new" a protected ctor in a different package
|
||||
mods ^= Modifier.PROTECTED;
|
||||
}
|
||||
if (Modifier.isFinal(mods) &&
|
||||
MethodHandleNatives.refKindIsSetter(refKind))
|
||||
throw m.makeAccessException("unexpected set of a final field", this);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user