diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2012-02-19 13:06:30 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2012-02-19 13:06:30 +0000 |
commit | 6485ea4d665ac2882272d8ebbed0916dde991a52 (patch) | |
tree | 577cae7463393f5b63a2c0270cff88b73503e5d5 | |
parent | e50d7c0862acc66ca1d6b26ec126eb3ed5295d7d (diff) | |
download | javassist-6485ea4d665ac2882272d8ebbed0916dde991a52.tar.gz javassist-6485ea4d665ac2882272d8ebbed0916dde991a52.zip |
fixed JASSIST-151
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@616 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
-rw-r--r-- | Readme.html | 2 | ||||
-rw-r--r-- | src/main/javassist/runtime/Desc.java | 3 | ||||
-rw-r--r-- | src/test/javassist/JvstTest4.java | 10 |
3 files changed, 12 insertions, 3 deletions
diff --git a/Readme.html b/Readme.html index 022268c5..af8197f2 100644 --- a/Readme.html +++ b/Readme.html @@ -283,7 +283,7 @@ see javassist.Dump. <p>-version 3.16 <ul> - <li>JIRA JASSIST-126, 127, 144, 145, 146, 147, 149, 150, 152, 153, 155. + <li>JIRA JASSIST-126, 127, 144, 145, 146, 147, 149, 150, 151, 152, 153, 155. <li><code>javassist.bytecode.analysis.ControlFlow</code> was added. </ul> diff --git a/src/main/javassist/runtime/Desc.java b/src/main/javassist/runtime/Desc.java index ee20d059..0b1cef51 100644 --- a/src/main/javassist/runtime/Desc.java +++ b/src/main/javassist/runtime/Desc.java @@ -38,8 +38,7 @@ public class Desc { throws ClassNotFoundException { if (useContextClassLoader) - return Thread.currentThread().getContextClassLoader() - .loadClass(name); + return Class.forName(name, true, Thread.currentThread().getContextClassLoader()); else return Class.forName(name); } diff --git a/src/test/javassist/JvstTest4.java b/src/test/javassist/JvstTest4.java index a3c47ee1..1f3612d8 100644 --- a/src/test/javassist/JvstTest4.java +++ b/src/test/javassist/JvstTest4.java @@ -701,4 +701,14 @@ public class JvstTest4 extends JvstTestRoot { Object obj = make(cc.getName()); assertEquals(1, invoke(obj, "test")); } + + public void testJIRA151() { + // try it using classloader of TestDescForName Desc.useContextClassLoader = false; + assertTrue(javassist.runtime.Desc.getClazz("[Ljava.lang.String;") != null); + //Thread.currentThread().setContextClassLoader(TestDescForName.class.getClassLoader()); + boolean old = javassist.runtime.Desc.useContextClassLoader; + javassist.runtime.Desc.useContextClassLoader = true; + assertTrue(javassist.runtime.Desc.getClazz("[Ljava.lang.String;") != null); + javassist.runtime.Desc.useContextClassLoader = old; + } } |