File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
test/hotspot/jtreg/runtime/cds/appcds/aotClassLinking Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 72
72
import java .lang .StackWalker .StackFrame ;
73
73
import java .net .URL ;
74
74
import java .net .URLClassLoader ;
75
+ import java .util .ArrayList ;
75
76
import java .util .List ;
76
77
import java .util .regex .Matcher ;
77
78
import java .util .regex .Pattern ;
@@ -312,12 +313,15 @@ static void checkCustomLoader() throws Exception {
312
313
}
313
314
}
314
315
316
+ static ArrayList <ClassLoader > savedLoaders = new ArrayList <>();
317
+
315
318
static Object initFromCustomLoader () throws Exception {
316
319
String path = "cust.jar" ;
317
320
URL url = new File (path ).toURI ().toURL ();
318
321
URL [] urls = new URL [] {url };
319
322
URLClassLoader urlClassLoader =
320
323
new URLClassLoader ("MyLoader" , urls , null );
324
+ savedLoaders .add (urlClassLoader );
321
325
Class c = Class .forName ("SimpleCusty" , true , urlClassLoader );
322
326
return c .newInstance ();
323
327
}
You can’t perform that action at this time.
0 commit comments