jdk/src/java.base/share/classes/java/lang/Class.java
changeset 46047 97d615d81827
parent 45705 a4239e9b21a3
child 46878 5efde8404604
child 46096 62c77b334012
--- a/jdk/src/java.base/share/classes/java/lang/Class.java	Fri Jul 28 02:34:40 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/Class.java	Fri Jul 28 13:22:33 2017 -0700
@@ -364,9 +364,9 @@
             // Reflective call to get caller class is only needed if a security manager
             // is present.  Avoid the overhead of making this call otherwise.
             caller = Reflection.getCallerClass();
-            if (VM.isSystemDomainLoader(loader)) {
+            if (loader == null) {
                 ClassLoader ccl = ClassLoader.getClassLoader(caller);
-                if (!VM.isSystemDomainLoader(ccl)) {
+                if (ccl != null) {
                     sm.checkPermission(
                         SecurityConstants.GET_CLASSLOADER_PERMISSION);
                 }