8027020: [regression] java.lang.VerifyError: Bad type on operand stack
authorsundar
Tue, 22 Oct 2013 22:04:46 +0530
changeset 21451 ea5d24a4fb35
parent 21450 419e5d51f319
child 21452 57f27f2017c4
child 21453 b48953eede53
8027020: [regression] java.lang.VerifyError: Bad type on operand stack Reviewed-by: jlaskey, attila
nashorn/src/jdk/nashorn/internal/runtime/ScriptLoader.java
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptLoader.java	Tue Oct 22 17:52:37 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptLoader.java	Tue Oct 22 22:04:46 2013 +0530
@@ -52,24 +52,10 @@
     @Override
     protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
         checkPackageAccess(name);
-        try {
-            return super.loadClass(name, resolve);
-        } catch (final ClassNotFoundException | SecurityException e) {
-            // We'll get ClassNotFoundException for Nashorn 'struct' classes.
-            // Also, we'll get SecurityException for jdk.nashorn.internal.*
-            // classes. So, load these using to context's 'shared' loader.
-            // All these classes start with "jdk.nashorn.internal." prefix.
-            try {
-                if (name.startsWith(NASHORN_PKG_PREFIX)) {
-                    return context.getSharedLoader().loadClass(name);
-                }
-            } catch (final ClassNotFoundException ignored) {
-                //ignored
-            }
-
-            // throw the original exception from here
-            throw e;
+        if (name.startsWith(NASHORN_PKG_PREFIX)) {
+            return context.getSharedLoader().loadClass(name);
         }
+        return super.loadClass(name, resolve);
     }
 
     // package-private and private stuff below this point