8035788: Provide more consistency for lookups

Reviewed-by: jrose, vlivanov, ahgross
This commit is contained in:
Christian Thalinger 2014-07-14 13:57:44 +04:00
parent 9aefc3174c
commit 33ccc261e0

View File

@ -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);