8068578: test/java/io/Serializable/subclassGC/SubclassGC.java assumes app class loader is a URLClassLoader
Reviewed-by: alanb
This commit is contained in:
parent
60fdd0dceb
commit
76ace03a9e
@ -50,8 +50,9 @@ public class SubclassGC {
|
||||
}
|
||||
|
||||
ClassLoader systemLoader = ClassLoader.getSystemClassLoader();
|
||||
ClassLoader loader = new URLClassLoader(((URLClassLoader) systemLoader).getURLs(),
|
||||
systemLoader.getParent());
|
||||
URL testClassesURL = new File(System.getProperty("test.classes")).toURI().toURL();
|
||||
ClassLoader loader = new URLClassLoader(new URL[] { testClassesURL } ,
|
||||
systemLoader.getParent());
|
||||
Class<? extends ObjectOutputStream> cl =
|
||||
Class.forName(SubclassOfOOS.class.getName(), false,
|
||||
loader).asSubclass(ObjectOutputStream.class);
|
||||
|
@ -2,5 +2,7 @@
|
||||
grant {
|
||||
permission java.lang.RuntimePermission "createClassLoader";
|
||||
permission java.lang.RuntimePermission "getClassLoader";
|
||||
permission java.util.PropertyPermission "test.classes", "read";
|
||||
permission java.io.FilePermission "<<ALL FILES>>", "read";
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user