diff --git a/test/ProblemList.txt b/test/ProblemList.txt index 46fa2f07befccf7390fd901da8505cc864187e41..69406ecb061c63a15b387f37a08251090e7c36b3 100644 --- a/test/ProblemList.txt +++ b/test/ProblemList.txt @@ -1233,10 +1233,6 @@ java/util/logging/LoggingMXBeanTest2.java generic-all java/util/logging/LoggingNIOChange.java generic-all java/util/logging/ParentLoggersTest.java generic-all -# Need to be marked othervm, or changed to be samevm safe -java/util/ResourceBundle/Bug4168625Test.java generic-all -java/util/ResourceBundle/TestBug4179766.java generic-all - # Need to be marked othervm, or changed to be samevm safe java/util/WeakHashMap/GCDuringIteration.java generic-all diff --git a/test/java/util/ResourceBundle/Bug4168625Test.java b/test/java/util/ResourceBundle/Bug4168625Test.java index ef8d98698e522c02a5aea2275c9877c81bb28273..8dc213db170f90f1746f11564dca0803ae9a82b6 100644 --- a/test/java/util/ResourceBundle/Bug4168625Test.java +++ b/test/java/util/ResourceBundle/Bug4168625Test.java @@ -431,9 +431,11 @@ public class Bug4168625Test extends RBTestFmwk { private boolean network = false; public SimpleLoader() { + super(SimpleLoader.class.getClassLoader()); this.network = false; } public SimpleLoader(boolean simulateNetworkLoad) { + super(SimpleLoader.class.getClassLoader()); this.network = simulateNetworkLoad; } public Class loadClass(final String className, final boolean resolveIt) @@ -448,7 +450,7 @@ public class Bug4168625Test extends RBTestFmwk { } catch (java.lang.InterruptedException e) { } } - result = super.findSystemClass(className); + result = getParent().loadClass(className); if ((result != null) && resolveIt) { resolveClass(result); } @@ -464,11 +466,13 @@ public class Bug4168625Test extends RBTestFmwk { private String[] classesToWaitFor; public Loader() { + super(Loader.class.getClassLoader()); classesToLoad = new String[0]; classesToWaitFor = new String[0]; } public Loader(final String[] classesToLoadIn, final String[] classesToWaitForIn) { + super(Loader.class.getClassLoader()); classesToLoad = classesToLoadIn; classesToWaitFor = classesToWaitForIn; } @@ -544,10 +548,12 @@ public class Bug4168625Test extends RBTestFmwk { } /** - * Delegate loading to the system loader + * Delegate loading to its parent class loader that loads the test classes. + * In othervm mode, the parent class loader is the system class loader; + * in samevm mode, the parent class loader is the jtreg URLClassLoader. */ private Class loadFromSystem(String className) throws ClassNotFoundException { - return super.findSystemClass(className); + return getParent().loadClass(className); } public void logClasses(String title) { diff --git a/test/java/util/ResourceBundle/TestBug4179766.java b/test/java/util/ResourceBundle/TestBug4179766.java index 3546b1345949e21e779f808ed7720c95df49e647..0c6a8b9bc9c0e99f631d15352f6fbf67e2d33254 100644 --- a/test/java/util/ResourceBundle/TestBug4179766.java +++ b/test/java/util/ResourceBundle/TestBug4179766.java @@ -209,6 +209,7 @@ public class TestBug4179766 extends RBTestFmwk { * Create a new loader */ public Loader(boolean sameHash) { + super(Loader.class.getClassLoader()); if (sameHash) { thisHashCode = SAME_HASH_CODE; } else { @@ -287,7 +288,7 @@ public class TestBug4179766 extends RBTestFmwk { */ private Class loadFromSystem(String className) throws ClassNotFoundException { try { - Class result = super.findSystemClass(className); + Class result = getParent().loadClass(className); printInfo(" ***Returning system class: "+className, result); return result; } catch (ClassNotFoundException e) {