# HG changeset patch # User vtewari # Date 1491987908 -19800 # Node ID 4ad24a9cf0216acd2bc6c3a529c80aeb873548a7 # Parent 086c71b7b1ddbad118a963e51dcfe330aa562c69 8177656: Closed/nashorn/JDK_8034967.java starts failing (all platforms) since 9/154 Reviewed-by: jlaskey diff -r 086c71b7b1dd -r 4ad24a9cf021 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java --- 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