]> source.dussan.org Git - javassist.git/commitdiff
fixed a bug on method lookup.
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Wed, 10 Dec 2003 17:54:18 +0000 (17:54 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Wed, 10 Dec 2003 17:54:18 +0000 (17:54 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@57 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/ClassPool.java
src/main/javassist/CtClass.java
src/main/javassist/compiler/MemberResolver.java

index cb1fb7558703f9375dba2b498872d6c98b3dde60..29d8acb5c18bfab5b7531c0333d2426ce185bfcb 100644 (file)
@@ -571,6 +571,9 @@ public class ClassPool {
      * <p>If <code>classname</code> ends with "[]", then this method
      * returns a <code>CtClass</code> object for that array type.
      *
+     * <p>To obtain an inner class, use "$" instead of "." for separating
+     * the enclosing class name and the inner class name.
+     *
      * @param classname         a fully-qualified class name.
      */
     public synchronized CtClass get(String classname)
index 44cf76ae5d52ea7ba4bd7b2d3f3259232b3e2896..8d50a7b69bf0993b5f26653ba09654836e513c10 100644 (file)
@@ -35,7 +35,7 @@ public abstract class CtClass {
     /**
      * The version number of this release.
      */
-    public static final String version = "2.7 beta 4";
+    public static final String version = "2.7 alpha 5";
 
     /**
      * Prints the version number and the copyright notice.
index a96f3e66b2c98a3a8b6da8a9fb000a1804920d86..6e9c33c1434d21cdc0adfe98d4f0ba73b1bbd62a 100644 (file)
@@ -100,19 +100,20 @@ public class MemberResolver implements TokenId {
         }
         catch (NotFoundException e) {}
 
-        /* -- not necessary to search implemented interfaces.
-        try {
-            CtClass[] ifs = clazz.getInterfaces();
-            int size = ifs.length;
-            for (int i = 0; i < size; ++i) {
-                Object[] r = lookupMethod(ifs[i], methodName, argTypes,
-                                          argDims, argClassNames);
-                if (r != null)
-                    return r;
+        int mod = clazz.getModifiers();
+        if (Modifier.isAbstract(mod) || Modifier.isInterface(mod))
+            try {
+                CtClass[] ifs = clazz.getInterfaces();
+                int size = ifs.length;
+                for (int i = 0; i < size; ++i) {
+                    Method r = lookupMethod(ifs[i], null, methodName,
+                                            argTypes, argDims, argClassNames,
+                                            (onlyExact || maybe != null));
+                    if (r != null)
+                        return r;
+                }
             }
-        }
-        catch (NotFoundException e) {}
-        */
+            catch (NotFoundException e) {}
 
         if (onlyExact)
             return null;