src/jdk/nashorn/internal/runtime/Context.java

changeset 1837
27842bf384fe
parent 1836
301f57f44dfc
child 1959
61ffdd1b89f2
equal deleted inserted replaced
1836:301f57f44dfc 1837:27842bf384fe
1045 if (sm != null) { 1045 if (sm != null) {
1046 checkPackageAccess(sm, fullName); 1046 checkPackageAccess(sm, fullName);
1047 } 1047 }
1048 1048
1049 // Try finding using the "app" loader. 1049 // Try finding using the "app" loader.
1050 return Class.forName(fullName, true, appLoader); 1050 if (appLoader != null) {
1051 return Class.forName(fullName, true, appLoader);
1052 } else {
1053 final Class<?> cl = Class.forName(fullName);
1054 // return the Class only if it was loaded by boot loader
1055 if (cl.getClassLoader() == null) {
1056 return cl;
1057 } else {
1058 throw new ClassNotFoundException(fullName);
1059 }
1060 }
1051 } 1061 }
1052 1062
1053 /** 1063 /**
1054 * Hook to print stack trace for a {@link Throwable} that occurred during 1064 * Hook to print stack trace for a {@link Throwable} that occurred during
1055 * execution 1065 * execution

mercurial