aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2003-12-10 17:54:18 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2003-12-10 17:54:18 +0000
commit8e20f83d119aef0c906488cd87c7f665fbc3daf6 (patch)
tree3fe6b9a349bf61614bb894480f09bf4c1f146b5c
parent2467ddfb2132c361d0b36315c17055606487368d (diff)
downloadjavassist-8e20f83d119aef0c906488cd87c7f665fbc3daf6.tar.gz
javassist-8e20f83d119aef0c906488cd87c7f665fbc3daf6.zip
fixed a bug on method lookup.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@57 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
-rw-r--r--src/main/javassist/ClassPool.java3
-rw-r--r--src/main/javassist/CtClass.java2
-rw-r--r--src/main/javassist/compiler/MemberResolver.java25
3 files changed, 17 insertions, 13 deletions
diff --git a/src/main/javassist/ClassPool.java b/src/main/javassist/ClassPool.java
index cb1fb755..29d8acb5 100644
--- a/src/main/javassist/ClassPool.java
+++ b/src/main/javassist/ClassPool.java
@@ -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)
diff --git a/src/main/javassist/CtClass.java b/src/main/javassist/CtClass.java
index 44cf76ae..8d50a7b6 100644
--- a/src/main/javassist/CtClass.java
+++ b/src/main/javassist/CtClass.java
@@ -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.
diff --git a/src/main/javassist/compiler/MemberResolver.java b/src/main/javassist/compiler/MemberResolver.java
index a96f3e66..6e9c33c1 100644
--- a/src/main/javassist/compiler/MemberResolver.java
+++ b/src/main/javassist/compiler/MemberResolver.java
@@ -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;