diff --git a/jcl/src/java.base/share/classes/java/lang/Class.java b/jcl/src/java.base/share/classes/java/lang/Class.java index 91f0b5d89d0..4cc5414e7cf 100644 --- a/jcl/src/java.base/share/classes/java/lang/Class.java +++ b/jcl/src/java.base/share/classes/java/lang/Class.java @@ -3204,7 +3204,9 @@ public boolean desiredAssertionStatus() { * array of not more than maxDepth Classes representing the classes of * running methods on the stack (including native methods). Frames * representing the VM implementation of java.lang.reflect are not included - * in the list. If stopAtPrivileged is true, the walk will terminate at any + * in the list. +/*[IF JAVA_SPEC_VERSION < 24] + * If stopAtPrivileged is true, the walk will terminate at any * frame running one of the following methods: * * * * If one of the doPrivileged methods is found, the walk terminate and that frame is NOT included in the returned array. +/*[ENDIF] JAVA_SPEC_VERSION < 24 * * Notes: * * @param maxDepth maximum depth to walk the stack, -1 for the entire stack +/*[IF JAVA_SPEC_VERSION >= 24] + * @param stopAtPrivileged has no effect +/*[ELSE] JAVA_SPEC_VERSION >= 24 * @param stopAtPrivileged stop at privileged classes +/*[ENDIF] JAVA_SPEC_VERSION >= 24 * @return the array of the most recent classes on the stack */ @CallerSensitive diff --git a/jcl/src/java.base/share/classes/java/security/AccessControlContext.java b/jcl/src/java.base/share/classes/java/security/AccessControlContext.java index bb9a3cecdc1..de86aff22a6 100644 --- a/jcl/src/java.base/share/classes/java/security/AccessControlContext.java +++ b/jcl/src/java.base/share/classes/java/security/AccessControlContext.java @@ -726,6 +726,13 @@ private boolean debugHelper(Permission perm) { } /** +/*[IF JAVA_SPEC_VERSION >= 24] + * Throws java.security.AccessControlException + * + * @param perm is ignored + * @exception java.security.AccessControlException + * is always thrown +/*[ELSE] JAVA_SPEC_VERSION >= 24 * Checks if the permission perm is allowed in this context. * All ProtectionDomains must grant the permission for it to be granted. * @@ -735,6 +742,7 @@ private boolean debugHelper(Permission perm) { * thrown when perm is not granted. * @exception NullPointerException * if perm is null +/*[ENDIF] JAVA_SPEC_VERSION >= 24 */ public void checkPermission(Permission perm) throws AccessControlException { /*[IF JAVA_SPEC_VERSION >= 24]*/ @@ -946,6 +954,7 @@ ProtectionDomain[] getContext() { return context; } +/*[IF JAVA_SPEC_VERSION < 24]*/ /* * Added to resolve: S6907662, CVE-2010-4465: System clipboard should ensure access restrictions * Called internally from java.security.ProtectionDomain @@ -959,6 +968,7 @@ ProtectionDomain[] getContext() { this.domainCombiner = acc.domainCombiner; } } +/*[ENDIF] JAVA_SPEC_VERSION < 24 */ /* * Added to resolve: S6907662, CVE-2010-4465: System clipboard should ensure access restrictions diff --git a/jcl/src/java.base/share/classes/java/security/AccessController.java b/jcl/src/java.base/share/classes/java/security/AccessController.java index ba55c1b21f3..8bb613bccbb 100644 --- a/jcl/src/java.base/share/classes/java/security/AccessController.java +++ b/jcl/src/java.base/share/classes/java/security/AccessController.java @@ -46,30 +46,30 @@ @SuppressWarnings("removal") /*[ENDIF] JAVA_SPEC_VERSION >= 17 */ public final class AccessController { +/*[IF JAVA_SPEC_VERSION >= 24]*/ + private static final AccessControlContext ACC_NO_PERM = new AccessControlContext( + new ProtectionDomain[] { new ProtectionDomain(null, null) }); +/*[ELSE] JAVA_SPEC_VERSION >= 24 */ static { // Initialize vm-internal caches initializeInternal(); } -/*[IF JAVA_SPEC_VERSION >= 24]*/ - private static AccessControlContext ACC_NO_PERM = new AccessControlContext( - new ProtectionDomain[] { new ProtectionDomain(null, null) }); -/*[ENDIF] JAVA_SPEC_VERSION >= 24 */ - static final int OBJS_INDEX_ACC = 0; static final int OBJS_INDEX_PDS = 1; static final int OBJS_ARRAY_SIZE = 3; static final int OBJS_INDEX_PERMS_OR_CACHECHECKED = 2; -private static native void initializeInternal(); + private static native void initializeInternal(); -/* [PR CMVC 188787] Enabling -Djava.security.debug option within WAS keeps JVM busy */ -static final class DebugRecursionDetection { - private static ThreadLocal tlDebug = new ThreadLocal<>(); - static ThreadLocal getTlDebug() { - return tlDebug; + /* [PR CMVC 188787] Enabling -Djava.security.debug option within WAS keeps JVM busy */ + static final class DebugRecursionDetection { + private static ThreadLocal tlDebug = new ThreadLocal<>(); + static ThreadLocal getTlDebug() { + return tlDebug; + } } -} +/*[ENDIF] JAVA_SPEC_VERSION >= 24 */ /*[PR 1FDIC6B] J9JCL:WIN95 - AccessController missing private no-arg constructor */ /** @@ -79,6 +79,7 @@ private AccessController() { super(); } +/*[IF JAVA_SPEC_VERSION < 24]*/ /** * The object array returned has following format: * @@ -155,7 +156,6 @@ private AccessController() { */ private static native ProtectionDomain getCallerPD(int depth); -/*[IF JAVA_SPEC_VERSION < 24]*/ /** * provide debug info according to debug settings before throwing AccessControlException * @@ -279,7 +279,6 @@ private static boolean checkPermissionHelper(Permission perm, AccessControlConte } return limitedPermImplied; } -/*[ENDIF] JAVA_SPEC_VERSION < 24 */ /** * Helper to print debug stack information for checkPermission(). @@ -369,8 +368,15 @@ private static boolean debugHelperJEP140(Object[] objects, Permission perm) { debugPrintStack(debug, perm); return debug; } +/*[ENDIF] JAVA_SPEC_VERSION < 24 */ /** +/*[IF JAVA_SPEC_VERSION >= 24] + * Throws AccessControlException + * + * @param perm is ignored + * @exception AccessControlException is always thrown +/*[ELSE] JAVA_SPEC_VERSION >= 24 * Checks whether the running program is allowed to * access the resource being guarded by the given * Permission argument. @@ -378,6 +384,7 @@ private static boolean debugHelperJEP140(Object[] objects, Permission perm) { * @param perm the permission to check * @exception AccessControlException if access is not allowed. * NullPointerException if perm is null +/*[ENDIF] JAVA_SPEC_VERSION >= 24 */ public static void checkPermission(Permission perm) throws AccessControlException { /*[IF JAVA_SPEC_VERSION >= 24]*/ @@ -441,24 +448,9 @@ public static void checkPermission(Permission perm) throws AccessControlExceptio } /** - * Used to keep the context live during doPrivileged(). - * - * @param context the context to retain - * - * @see #doPrivileged(PrivilegedAction, AccessControlContext) - */ -private static void keepalive(AccessControlContext context) { - return; -} - -/** - * @param perms the permissions to retain - */ -private static void keepalive(Permission... perms) { - return; -} - -/** +/*[IF JAVA_SPEC_VERSION >= 24] + * @return an AccessControlContext with no permissions +/*[ELSE] JAVA_SPEC_VERSION >= 24 * Answers the access controller context of the current thread, * including the inherited ones. It basically retrieves all the * protection domains from the calling stack and creates an @@ -467,6 +459,7 @@ private static void keepalive(Permission... perms) { * @return an AccessControlContext which captures the current state * * @see AccessControlContext +/*[ENDIF] JAVA_SPEC_VERSION >= 24 */ public static AccessControlContext getContext() { /*[IF JAVA_SPEC_VERSION >= 24]*/ @@ -476,6 +469,25 @@ public static AccessControlContext getContext() { /*[ENDIF] JAVA_SPEC_VERSION >= 24 */ } +/*[IF JAVA_SPEC_VERSION < 24]*/ +/** + * Used to keep the context live during doPrivileged(). + * + * @param context the context to retain + * + * @see #doPrivileged(PrivilegedAction, AccessControlContext) + */ +private static void keepalive(AccessControlContext context) { + return; +} + +/** + * @param perms the permissions to retain + */ +private static void keepalive(Permission... perms) { + return; +} + /** * This is a helper method for getContext() and doPrivilegedWithCombiner methods. * Answers the access controller context of the current thread including the inherited ones. @@ -624,9 +636,6 @@ private static ProtectionDomain[] generatePDarray(DomainCombiner activeDC, Acces * @return AccessControlContext.STATE_AUTHORIZED or STATE_NOT_AUTHORIZED (can't be STATE_UNKNOWN) */ private static int getNewAuthorizedState(AccessControlContext acc, ProtectionDomain callerPD) { - /*[IF JAVA_SPEC_VERSION >= 24]*/ - return AccessControlContext.STATE_AUTHORIZED; - /*[ELSE] JAVA_SPEC_VERSION >= 24 */ int newAuthorizedState; /*[PR JAZZ 87596] PMR 18839,756,000 - Need to trust AccessControlContext created without active SecurityManager */ if ((null != acc) && (null != System.getSecurityManager())) { @@ -643,7 +652,6 @@ private static int getNewAuthorizedState(AccessControlContext acc, ProtectionDom newAuthorizedState = AccessControlContext.STATE_AUTHORIZED; } return newAuthorizedState; - /*[ENDIF] JAVA_SPEC_VERSION >= 24 */ } /** @@ -712,6 +720,7 @@ static ProtectionDomain[] toArrayOfProtectionDomains(Object[] domains, AccessCon return answer; } +/*[ENDIF] JAVA_SPEC_VERSION < 24 */ /** * Performs the privileged action specified by action. @@ -760,10 +769,14 @@ public static T doPrivileged(PrivilegedAction action) { */ @CallerSensitive public static T doPrivileged(PrivilegedAction action, AccessControlContext context) { + /*[IF JAVA_SPEC_VERSION >= 24]*/ + return action.run(); + /*[ELSE] JAVA_SPEC_VERSION >= 24 */ T result = action.run(); /*[PR 108112] context is not kept alive*/ keepalive(context); return result; + /*[ENDIF] JAVA_SPEC_VERSION >= 24 */ } /** @@ -827,10 +840,14 @@ public static T doPrivileged (PrivilegedExceptionAction action, AccessCon throws PrivilegedActionException { try { + /*[IF JAVA_SPEC_VERSION >= 24]*/ + return action.run(); + /*[ELSE] JAVA_SPEC_VERSION >= 24 */ T result = action.run(); /*[PR 108112] context is not kept alive*/ keepalive(context); return result; + /*[ENDIF] JAVA_SPEC_VERSION >= 24 */ } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { @@ -857,7 +874,11 @@ public static T doPrivileged (PrivilegedExceptionAction action, AccessCon */ @CallerSensitive public static T doPrivilegedWithCombiner(PrivilegedAction action) { + /*[IF JAVA_SPEC_VERSION >= 24]*/ + return doPrivileged(action, null); + /*[ELSE] JAVA_SPEC_VERSION >= 24 */ return doPrivileged(action, doPrivilegedWithCombinerHelper(null)); + /*[ENDIF] JAVA_SPEC_VERSION >= 24 */ } /** @@ -884,9 +905,14 @@ public static T doPrivilegedWithCombiner(PrivilegedAction action) { public static T doPrivilegedWithCombiner(PrivilegedExceptionAction action) throws PrivilegedActionException { + /*[IF JAVA_SPEC_VERSION >= 24]*/ + return doPrivileged(action, null); + /*[ELSE] JAVA_SPEC_VERSION >= 24 */ return doPrivileged(action, doPrivilegedWithCombinerHelper(null)); + /*[ENDIF] JAVA_SPEC_VERSION >= 24 */ } +/*[IF JAVA_SPEC_VERSION < 24]*/ /** * Helper method to check if any permission is null * @@ -902,6 +928,7 @@ private static void checkPermsNPE(Permission... perms) { } } } +/*[ENDIF] JAVA_SPEC_VERSION < 24 */ /** * Performs the privileged action specified by action. @@ -930,11 +957,15 @@ private static void checkPermsNPE(Permission... perms) { public static T doPrivileged(PrivilegedAction action, AccessControlContext context, Permission... perms) { + /*[IF JAVA_SPEC_VERSION >= 24]*/ + return action.run(); + /*[ELSE] JAVA_SPEC_VERSION >= 24 */ checkPermsNPE(perms); T result = action.run(); keepalive(context); keepalive(perms); return result; + /*[ENDIF] JAVA_SPEC_VERSION >= 24 */ } /** @@ -962,8 +993,12 @@ public static T doPrivileged(PrivilegedAction action, public static T doPrivilegedWithCombiner(PrivilegedAction action, AccessControlContext context, Permission... perms) { + /*[IF JAVA_SPEC_VERSION >= 24]*/ + return doPrivileged(action, context, perms); + /*[ELSE] JAVA_SPEC_VERSION >= 24 */ checkPermsNPE(perms); return doPrivileged(action, doPrivilegedWithCombinerHelper(context), perms); + /*[ENDIF] JAVA_SPEC_VERSION >= 24 */ } /** @@ -997,11 +1032,15 @@ public static T doPrivileged(PrivilegedExceptionAction action, throws PrivilegedActionException { try { + /*[IF JAVA_SPEC_VERSION >= 24]*/ + return action.run(); + /*[ELSE] JAVA_SPEC_VERSION >= 24 */ checkPermsNPE(perms); T result = action.run(); keepalive(context); keepalive(perms); return result; + /*[ENDIF] JAVA_SPEC_VERSION >= 24 */ } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { @@ -1037,10 +1076,15 @@ public static T doPrivilegedWithCombiner(PrivilegedExceptionAction action AccessControlContext context, Permission... perms) throws PrivilegedActionException { + /*[IF JAVA_SPEC_VERSION >= 24]*/ + return doPrivileged(action, context, perms); + /*[ELSE] JAVA_SPEC_VERSION >= 24 */ checkPermsNPE(perms); return doPrivileged(action, doPrivilegedWithCombinerHelper(context), perms); + /*[ENDIF] JAVA_SPEC_VERSION >= 24 */ } +/*[IF JAVA_SPEC_VERSION < 24]*/ /** * Helper method to construct an AccessControlContext for doPrivilegedWithCombiner methods. * @@ -1060,5 +1104,6 @@ private static AccessControlContext doPrivilegedWithCombinerHelper(AccessControl } return fixedContext; } +/*[ENDIF] JAVA_SPEC_VERSION < 24 */ } diff --git a/runtime/jcl/CMakeLists.txt b/runtime/jcl/CMakeLists.txt index 55127cbb450..eac75caf922 100644 --- a/runtime/jcl/CMakeLists.txt +++ b/runtime/jcl/CMakeLists.txt @@ -106,7 +106,6 @@ target_link_libraries(jclse target_sources(jclse PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/common/acccont.c ${CMAKE_CURRENT_SOURCE_DIR}/common/annparser.c ${CMAKE_CURRENT_SOURCE_DIR}/common/attach.c ${CMAKE_CURRENT_SOURCE_DIR}/common/bootstrp.c @@ -238,6 +237,10 @@ if(NOT JAVA_SPEC_VERSION LESS 19) ) endif() +if(JAVA_SPEC_VERSION LESS 24) + target_sources(jclse PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/common/acccont.c) +endif() + if(J9VM_OPT_JFR) # JFR sources if(JAVA_SPEC_VERSION EQUAL 11) diff --git a/runtime/jcl/common/java_lang_Class.cpp b/runtime/jcl/common/java_lang_Class.cpp index fb26b2f1232..b298bd2231e 100644 --- a/runtime/jcl/common/java_lang_Class.cpp +++ b/runtime/jcl/common/java_lang_Class.cpp @@ -44,6 +44,9 @@ typedef enum { STATE_IMPLIED = 1 } StackWalkingStates; +#define STACK_WALK_STATE_MAGIC ((void *)1) + +#if JAVA_SPEC_VERSION < 24 typedef enum { OBJS_ARRAY_IDX_ACC = 0, OBJS_ARRAY_IDX_PDS = 1, @@ -51,14 +54,15 @@ typedef enum { OBJS_ARRAY_SIZE = 3 } ObjsArraySizeNindex; -#define STACK_WALK_STATE_MAGIC (void *)1 -#define STACK_WALK_STATE_LIMITED_DOPRIVILEGED (void *)2 -#define STACK_WALK_STATE_FULL_DOPRIVILEGED (void *)3 +#define STACK_WALK_STATE_LIMITED_DOPRIVILEGED ((void *)2) +#define STACK_WALK_STATE_FULL_DOPRIVILEGED ((void *)3) static UDATA isPrivilegedFrameIterator(J9VMThread * currentThread, J9StackWalkState * walkState); static UDATA isPrivilegedFrameIteratorGetAccSnapshot(J9VMThread * currentThread, J9StackWalkState * walkState); static UDATA frameIteratorGetAccSnapshotHelper(J9VMThread * currentThread, J9StackWalkState * walkState, j9object_t acc, j9object_t perm); static j9object_t storePDobjectsHelper(J9VMThread* vmThread, J9Class* arrayClass, J9StackWalkState* walkState, j9object_t contextObject, U_32 arraySize, UDATA framesWalked, I_32 startPos, BOOLEAN dupCallerPD); +#endif /* JAVA_SPEC_VERSION < 24 */ + static BOOLEAN checkInnerClassHelper(J9Class* declaringClass, J9Class* declaredClass); jobject JNICALL @@ -80,6 +84,7 @@ Java_java_lang_Class_getDeclaredAnnotationsData(JNIEnv *env, jobject jlClass) return result; } +#if JAVA_SPEC_VERSION < 24 static UDATA isPrivilegedFrameIterator(J9VMThread * currentThread, J9StackWalkState * walkState) { @@ -129,6 +134,7 @@ isPrivilegedFrameIterator(J9VMThread * currentThread, J9StackWalkState * walkSta return J9_STACKWALK_KEEP_ITERATING; } +#endif /* JAVA_SPEC_VERSION < 24 */ jobject JNICALL Java_java_lang_Class_getStackClasses(JNIEnv *env, jclass jlHeapClass, jint maxDepth, jboolean stopAtPrivileged) @@ -165,10 +171,12 @@ Java_java_lang_Class_getStackClasses(JNIEnv *env, jclass jlHeapClass, jint maxDe walkState.maxFrames = maxDepth; walkState.walkThread = vmThread; +#if JAVA_SPEC_VERSION < 24 if (stopAtPrivileged) { walkFlags |= J9_STACKWALK_ITERATE_FRAMES; walkState.frameWalkFunction = isPrivilegedFrameIterator; } +#endif /* JAVA_SPEC_VERSION < 24 */ walkState.flags = walkFlags; if (vm->walkStackFrames(vmThread, &walkState) != J9_STACKWALK_RC_NONE) { @@ -1201,6 +1209,7 @@ Java_java_lang_Class_permittedSubclassesImpl(JNIEnv *env, jobject cls) return permittedSubclassesHelper(env, cls); } +#if JAVA_SPEC_VERSION < 24 static UDATA frameIteratorGetAccSnapshotHelper(J9VMThread * currentThread, J9StackWalkState * walkState, j9object_t acc, j9object_t perm) { @@ -1423,13 +1432,11 @@ Java_java_security_AccessController_getAccSnapshot(JNIEnv* env, jclass jsAccessC if (NULL != vmThread->currentException) { goto _walkStateUninitialized; } -#if JAVA_SPEC_VERSION < 24 /* AccessControlContext is allocated in the same space as the thread, so no exception can occur */ contextObject = vmThread->threadObject; if (NULL != contextObject) { contextObject = J9VMJAVALANGTHREAD_INHERITEDACCESSCONTROLCONTEXT(vmThread, contextObject); } -#endif /* JAVA_SPEC_VERSION < 24 */ /* Walk the stack, caching the constant pools of the frames. */ walkState.skipCount = startingFrame + 1; /* skip this JNI frame as well */ walkState.userData1 = STACK_WALK_STATE_MAGIC; /* set to NULL when a limited doPrivileged frame is discovered */ @@ -1821,7 +1828,7 @@ storePDobjectsHelper(J9VMThread* vmThread, J9Class* arrayClass, J9StackWalkState } return arrayObject; } - +#endif /* JAVA_SPEC_VERSION < 24 */ jobject JNICALL Java_java_lang_Class_getNestHostImpl(JNIEnv *env, jobject recv) diff --git a/runtime/jcl/common/java_lang_Class.h b/runtime/jcl/common/java_lang_Class.h index ca1c3a2e5bd..cc6dc4c6398 100644 --- a/runtime/jcl/common/java_lang_Class.h +++ b/runtime/jcl/common/java_lang_Class.h @@ -25,11 +25,13 @@ /* @ddr_namespace: default */ #include "j9.h" +#if JAVA_SPEC_VERSION < 24 typedef struct DoPrivilegedMethodArgs { UDATA frameCounter; /* the frame just walked */ j9object_t accControlContext; /* arg0EA[-1] - AccessControlContext */ j9object_t permissions; /* arg0EA[-2] - Limited permission array */ struct DoPrivilegedMethodArgs* next; /* next DoPrivilegedMethodArgs structure */ } DoPrivilegedMethodArgs; +#endif /* JAVA_SPEC_VERSION < 24 */ #endif /* java_lang_Class_h */ diff --git a/runtime/jcl/exports.cmake b/runtime/jcl/exports.cmake index 4c548bd0eb9..eb6832377ec 100644 --- a/runtime/jcl/exports.cmake +++ b/runtime/jcl/exports.cmake @@ -376,7 +376,6 @@ omr_add_exports(jclse Java_java_lang_reflect_Proxy_defineClassImpl Java_java_security_AccessController_getAccSnapshot Java_java_security_AccessController_getCallerPD - Java_java_security_AccessController_initializeInternal Java_java_util_stream_IntPipeline_promoteGPUCompile Java_jdk_internal_misc_Unsafe_allocateDBBMemory Java_jdk_internal_misc_Unsafe_copySwapMemory0 @@ -455,6 +454,12 @@ omr_add_exports(jclse ) endif() +if(JAVA_SPEC_VERSION LESS 24) +omr_add_exports(jclse + Java_java_security_AccessController_initializeInternal +) +endif() + if(J9VM_OPT_METHOD_HANDLE) omr_add_exports(jclse Java_java_lang_invoke_InterfaceHandle_registerNatives diff --git a/runtime/jcl/uma/se6_vm-side_natives_exports.xml b/runtime/jcl/uma/se6_vm-side_natives_exports.xml index 3792059bb71..9e5ce856d07 100644 --- a/runtime/jcl/uma/se6_vm-side_natives_exports.xml +++ b/runtime/jcl/uma/se6_vm-side_natives_exports.xml @@ -257,7 +257,9 @@ - + + + diff --git a/runtime/jcl/uma/se6_vm-side_natives_objects.xml b/runtime/jcl/uma/se6_vm-side_natives_objects.xml index 07384f71287..7d961af10e3 100644 --- a/runtime/jcl/uma/se6_vm-side_natives_objects.xml +++ b/runtime/jcl/uma/se6_vm-side_natives_objects.xml @@ -24,7 +24,9 @@ - + + + diff --git a/runtime/oti/j9nonbuilder.h b/runtime/oti/j9nonbuilder.h index ff3fbfdb467..64bb9e0e481 100644 --- a/runtime/oti/j9nonbuilder.h +++ b/runtime/oti/j9nonbuilder.h @@ -5861,10 +5861,12 @@ typedef struct J9JavaVM { /* extensionClassLoader holds the platform class loader in Java 11+ */ struct J9ClassLoader* extensionClassLoader; struct J9ClassLoader* applicationClassLoader; +#if JAVA_SPEC_VERSION < 24 UDATA doPrivilegedMethodID1; UDATA doPrivilegedMethodID2; UDATA doPrivilegedWithContextMethodID1; UDATA doPrivilegedWithContextMethodID2; +#endif /* JAVA_SPEC_VERSION < 24 */ void* defaultMemorySpace; j9object_t* systemThreadGroupRef; omrthread_monitor_t classLoaderBlocksMutex; @@ -6125,8 +6127,10 @@ typedef struct J9JavaVM { omrthread_monitor_t nativeLibraryMonitor; UDATA freePreviousClassLoaders; struct J9ClassLoader* anonClassLoader; +#if JAVA_SPEC_VERSION < 24 UDATA doPrivilegedWithContextPermissionMethodID1; UDATA doPrivilegedWithContextPermissionMethodID2; +#endif /* JAVA_SPEC_VERSION < 24 */ UDATA nativeLibrariesLoadMethodID; #if defined(J9VM_INTERP_CUSTOM_SPIN_OPTIONS) struct J9Pool *customSpinOptions; diff --git a/runtime/oti/jclprots.h b/runtime/oti/jclprots.h index c811ba3b934..63f45a0ef13 100644 --- a/runtime/oti/jclprots.h +++ b/runtime/oti/jclprots.h @@ -739,8 +739,10 @@ extern J9_CFUNC jclass defineClassCommon (JNIEnv *env, jobject classLoaderObject, jstring className, jbyteArray classRep, jint offset, jint length, jobject protectionDomain, UDATA *options, J9Class *hostClass, J9ClassPatchMap *patchMap, BOOLEAN validateName); +#if JAVA_SPEC_VERSION < 24 /* BBjclNativesCommonAccessController*/ jboolean JNICALL Java_java_security_AccessController_initializeInternal (JNIEnv *env, jclass thisClz); +#endif /* JAVA_SPEC_VERSION < 24 */ /* BBjclNativesCommonProxy*/ jclass JNICALL Java_java_lang_reflect_Proxy_defineClassImpl (JNIEnv * env, jclass recvClass, jobject classLoader, jstring className, jbyteArray classBytes);