8177036: Class.checkMemberAccess throws NPE when calling Class methods via JNI
authorredestad
Mon, 20 Mar 2017 21:40:07 +0100
changeset 44335 4034fe5a6b6c
parent 44274 b99239096fed
child 44336 9688370d8b66
8177036: Class.checkMemberAccess throws NPE when calling Class methods via JNI Reviewed-by: mchung, alanb
jdk/src/java.base/share/classes/java/lang/Class.java
--- a/jdk/src/java.base/share/classes/java/lang/Class.java	Mon Mar 20 09:18:42 2017 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/Class.java	Mon Mar 20 21:40:07 2017 +0100
@@ -2771,7 +2771,7 @@
          * In all other cases, it requires RuntimePermission("accessDeclaredMembers")
          * permission.
          */
-        final ClassLoader ccl = caller.getClassLoader0();
+        final ClassLoader ccl = ClassLoader.getClassLoader(caller);
         if (which != Member.PUBLIC) {
             final ClassLoader cl = getClassLoader0();
             if (ccl != cl) {