--- 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);
}