diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-03-27 09:04:23 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-03-28 08:42:59 +0700 |
commit | 918063dba17c4920662dc14542efc3b184d933a5 (patch) | |
tree | f83c2f7bbf881e240233b2d9450682a11673c506 /loadtime | |
parent | 1b7147bac95a35795d03029e00082a2695a99e95 (diff) | |
download | aspectj-918063dba17c4920662dc14542efc3b184d933a5.tar.gz aspectj-918063dba17c4920662dc14542efc3b184d933a5.zip |
Fix JRockitAgentTest.testJrockitRecursionProtection for JVM 9+
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'loadtime')
-rw-r--r-- | loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java b/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java index 223f66fbb..487ef0832 100644 --- a/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java +++ b/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java @@ -54,29 +54,16 @@ public class JRockitAgentTest extends TestCase { } public void testJrockitRecursionProtection() { - if (LangUtil.is9VMOrGreater()) { - // Skip test, not castable to URLClassLoader - return; - } - URLClassLoader thisLoader = (URLClassLoader) getClass().getClassLoader(); URL jrockit = FileUtil.getFileURL(new File("../lib/ext/jrockit/jrockit.jar")); URL[] urls = new URL[] {jrockit}; - thisLoader = new URLClassLoader(urls, thisLoader); - ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); - + URLClassLoader thisLoader = new URLClassLoader(urls, getClass().getClassLoader()); try { - /* Needed by Commons Logging */ - Thread.currentThread().setContextClassLoader(thisLoader.getParent()); - ClassLoader loader = new JRockitClassLoader(thisLoader); - Class.forName("java.lang.Object", false, loader); Class.forName("junit.framework.TestCase", false, loader); } catch (Exception ex) { ex.printStackTrace(); fail(ex.toString()); - } finally { - Thread.currentThread().setContextClassLoader(contextLoader); } } |