summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-02-19 13:06:30 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-02-19 13:06:30 +0000
commit6485ea4d665ac2882272d8ebbed0916dde991a52 (patch)
tree577cae7463393f5b63a2c0270cff88b73503e5d5 /src
parente50d7c0862acc66ca1d6b26ec126eb3ed5295d7d (diff)
downloadjavassist-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
Diffstat (limited to 'src')
-rw-r--r--src/main/javassist/runtime/Desc.java3
-rw-r--r--src/test/javassist/JvstTest4.java10
2 files changed, 11 insertions, 2 deletions
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;
+ }
}