changeset 16908:61d6601e2948

8177036: Class.checkMemberAccess throws NPE when calling Class methods via JNI Reviewed-by: mchung, alanb
author redestad
date Mon, 20 Mar 2017 21:40:07 +0100
parents f6bf027e88e9
children e4b869632f7d
files src/java.base/share/classes/java/lang/Class.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/Class.java	Mon Mar 20 09:18:42 2017 -0700
+++ b/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) {