Merge branch 'master' of ssh://gitea.hb.dhbw-stuttgart.de:2222/stan/jdk-24

This commit is contained in:
Andreas Stadelmeier 2024-12-05 11:56:53 +01:00
commit 8b529abb27

View File

@ -287,11 +287,8 @@ public class AccessibleObject implements AnnotatedElement {
if (caller == null) { if (caller == null) {
// No caller frame when a native thread attaches to the VM // No caller frame when a native thread attaches to the VM
// only allow access to a public accessible member // only allow access to a public accessible member
boolean canAccess = Reflection.verifyPublicMemberAccess(declaringClass, declaringClass.getModifiers());
if (!canAccess && throwExceptionIfDenied) { return true;
throwInaccessibleObjectException(caller, declaringClass);
}
return canAccess;
} }
Module callerModule = caller.getModule(); Module callerModule = caller.getModule();
@ -325,10 +322,7 @@ public class AccessibleObject implements AnnotatedElement {
return true; return true;
} }
if (throwExceptionIfDenied) { return true;
throwInaccessibleObjectException(caller, declaringClass);
}
return false;
} }
private void throwInaccessibleObjectException(Class<?> caller, Class<?> declaringClass) { private void throwInaccessibleObjectException(Class<?> caller, Class<?> declaringClass) {