]> source.dussan.org Git - javassist.git/commitdiff
Changed ClassPool.get() to accept the descriptors of array types.
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Mon, 16 May 2005 14:53:51 +0000 (14:53 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Mon, 16 May 2005 14:53:51 +0000 (14:53 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@170 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/ClassPool.java
src/main/javassist/expr/MethodCall.java

index 28b795c60bf7447e08d68d1fd2d7b000074a1982..bf1c73ac989287e6ac591c1bf3ef746d57d805c9 100644 (file)
@@ -22,6 +22,7 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URL;
 import java.util.Hashtable;
+import javassist.bytecode.Descriptor;
 
 /**
  * A container of <code>CtClass</code> objects.
@@ -348,6 +349,10 @@ public class ClassPool {
      * @return null if the class file could not be found.
      */
     protected CtClass createCtClass(String classname, boolean useCache) {
+        // accept "[L<class name>;" as a class name. 
+        if (classname.charAt(0) == '[')
+            classname = Descriptor.toClassName(classname);
+
         if (classname.endsWith("[]")) {
             String base = classname.substring(0, classname.indexOf('['));
             if ((!useCache || getCached(base) == null) && find(base) == null)
index 3bd7d098e08b43c8a26448fa459df514fb37bd34..ded74e0cf322411a35be43689f303fb756694022 100644 (file)
@@ -93,7 +93,10 @@ public class MethodCall extends Expr {
         else
             cname = cp.getMethodrefClassName(index);
 
-        return cname;
+         if (cname.charAt(0) == '[')
+             cname = Descriptor.toClassName(cname);
+
+         return cname;
     }
 
     /**