changeset 44794:4ad24a9cf021

8177656: Closed/nashorn/JDK_8034967.java starts failing (all platforms) since 9/154 Reviewed-by: jlaskey
author vtewari
date Wed, 12 Apr 2017 14:35:08 +0530
parents 086c71b7b1dd
children 25c2ace97728
files nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java	Wed Apr 19 13:38:54 2017 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java	Wed Apr 12 14:35:08 2017 +0530
@@ -114,7 +114,11 @@
             @Override
             public Class<?> loadClass(final String name, final boolean resolve) throws ClassNotFoundException {
                 try {
-                    Context.checkPackageAccess(name);
+                    final int i = name.lastIndexOf('.');
+                    if(i != -1){
+                        final String pkgName = name.substring(0,i);
+                        Context.checkPackageAccess(pkgName);
+                    }
                     return super.loadClass(name, resolve);
                 } catch (final SecurityException se) {
                     // we may be implementing an interface or extending a class that was