8177036: Class.checkMemberAccess throws NPE when calling Class methods via JNI
Reviewed-by: mchung, alanb
--- 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) {