< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/customLoader/test-classes/LoaderSegregation.java

Print this page

        

@@ -80,11 +80,12 @@
             } catch (ClassNotFoundException expected) {}
         }
 
         { // UNREGISTERED LOADER
             URLClassLoader urlClassLoader = new URLClassLoader(urls);
-            Class c2 = Util.defineClassFromJAR(urlClassLoader, jarFile, ONLY_BUILTIN);
+            Class<?> peerClass = Class.forName("Hello", false, urlClassLoader);
+            Class c2 = Util.defineClassFromJAR(peerClass, jarFile, ONLY_BUILTIN);
 
             if (c2.getClassLoader() != urlClassLoader) {
                 throw new RuntimeException("Error in test");
             }
 
< prev index next >