8138677: IllegalAccessException Class sun.usagetracker.UsageTrackerClient$4 (module java.base) can not access a member of class java.lang.management.ManagementFactory (module java.management)
authorjbachorik
Fri, 11 Dec 2015 14:02:41 +0100
changeset 35262 6ffcba13c973
parent 35261 0b35f1241d52
child 35263 4f66e1eabbe3
8138677: IllegalAccessException Class sun.usagetracker.UsageTrackerClient$4 (module java.base) can not access a member of class java.lang.management.ManagementFactory (module java.management) Reviewed-by: alanb, mchung, dholmes, erikj, ihse
jdk/make/lib/CoreLibraries.gmk
jdk/make/lib/LibCommon.gmk
jdk/src/java.base/share/native/include/jvm.h
jdk/src/java.management/share/native/include/jmm.h
jdk/src/java.management/share/native/libmanagement/VMManagementImpl.c
--- a/jdk/make/lib/CoreLibraries.gmk	Wed Dec 16 19:59:23 2015 +0300
+++ b/jdk/make/lib/CoreLibraries.gmk	Fri Dec 11 14:02:41 2015 +0100
@@ -25,6 +25,10 @@
 
 WIN_VERIFY_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify/verify.lib
 
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, jdk, lib/CoreLibraries.gmk))
+
+
 ##########################################################################################
 # libfdlibm is statically linked with libjava below and not delivered into the
 # product on its own.
@@ -119,6 +123,9 @@
     -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
     -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
 
+# Make it possible to override this variable
+LIBJAVA_MAPFILE ?= $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers
+
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
   BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c
@@ -146,7 +153,7 @@
     System.c_CFLAGS := $(VERSION_CFLAGS), \
     jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
-    MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
+    MAPFILE := $(LIBJAVA_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/, \
--- a/jdk/make/lib/LibCommon.gmk	Wed Dec 16 19:59:23 2015 +0300
+++ b/jdk/make/lib/LibCommon.gmk	Fri Dec 11 14:02:41 2015 +0100
@@ -27,6 +27,11 @@
 include MakeBase.gmk
 include NativeCompilation.gmk
 
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, jdk, lib/LibCommon.gmk))
+
+################################################################################
+
 GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
 
 # Absolute paths to lib files on windows for use in LDFLAGS. Should figure out a more
@@ -50,7 +55,7 @@
 # Find the default set of src dirs for a native library.
 # Param 1 - module name
 # Param 2 - library name
-FindSrcDirsForLib = \
+FindSrcDirsForLib += \
   $(call uniq, $(wildcard \
       $(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
       $(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
--- a/jdk/src/java.base/share/native/include/jvm.h	Wed Dec 16 19:59:23 2015 +0300
+++ b/jdk/src/java.base/share/native/include/jvm.h	Fri Dec 11 14:02:41 2015 +0100
@@ -208,6 +208,9 @@
 JNIEXPORT void JNICALL
 JVM_SetMethodInfo(JNIEnv* env, jobject frame);
 
+JNIEXPORT jobjectArray JNICALL
+JVM_GetVmArguments(JNIEnv *env);
+
 /*
  * java.lang.Thread
  */
--- a/jdk/src/java.management/share/native/include/jmm.h	Wed Dec 16 19:59:23 2015 +0300
+++ b/jdk/src/java.management/share/native/include/jmm.h	Fri Dec 11 14:02:41 2015 +0100
@@ -227,16 +227,10 @@
   jint         (JNICALL *GetOptionalSupport)     (JNIEnv *env,
                                                   jmmOptionalSupport* support_ptr);
 
-  /* This is used by JDK 6 and earlier.
-   * For JDK 7 and after, use GetInputArgumentArray.
-   */
-  jobject      (JNICALL *GetInputArguments)      (JNIEnv *env);
-
   jint         (JNICALL *GetThreadInfo)          (JNIEnv *env,
                                                   jlongArray ids,
                                                   jint maxDepth,
                                                   jobjectArray infoArray);
-  jobjectArray (JNICALL *GetInputArgumentArray)  (JNIEnv *env);
 
   jobjectArray (JNICALL *GetMemoryPools)         (JNIEnv* env, jobject mgr);
 
--- a/jdk/src/java.management/share/native/libmanagement/VMManagementImpl.c	Wed Dec 16 19:59:23 2015 +0300
+++ b/jdk/src/java.management/share/native/libmanagement/VMManagementImpl.c	Fri Dec 11 14:02:41 2015 +0100
@@ -112,7 +112,7 @@
 Java_sun_management_VMManagementImpl_getVmArguments0
   (JNIEnv *env, jobject dummy)
 {
-    return jmm_interface->GetInputArgumentArray(env);
+    return JVM_GetVmArguments(env);
 }
 
 JNIEXPORT jlong JNICALL