diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2008-05-06 05:34:36 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2008-05-06 05:34:36 +0000 |
commit | e48604525140c746404a637282cb7b1dd97c18c4 (patch) | |
tree | 9611ebfc13ecbb6dd5e9ffca08650f07c68ace95 | |
parent | 664bfcc3db3aa02fb9abfc799de8ff274dd6f1da (diff) | |
download | javassist-e48604525140c746404a637282cb7b1dd97c18c4.tar.gz javassist-e48604525140c746404a637282cb7b1dd97c18c4.zip |
fixed JIRA JASSIST-61
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@436 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
-rw-r--r-- | src/main/javassist/compiler/MemberResolver.java | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/main/javassist/compiler/MemberResolver.java b/src/main/javassist/compiler/MemberResolver.java index 858a235c..ee692c61 100644 --- a/src/main/javassist/compiler/MemberResolver.java +++ b/src/main/javassist/compiler/MemberResolver.java @@ -107,19 +107,24 @@ public class MemberResolver implements TokenId { throws CompileError { Method maybe = null; - List list = clazz.getClassFile2().getMethods(); - int n = list.size(); - for (int i = 0; i < n; ++i) { - MethodInfo minfo = (MethodInfo)list.get(i); - if (minfo.getName().equals(methodName)) { - int res = compareSignature(minfo.getDescriptor(), + ClassFile cf = clazz.getClassFile2(); + // If the class is an array type, the class file is null. + // If so, search the super class java.lang.Object for clone() etc. + if (cf != null) { + List list = cf.getMethods(); + int n = list.size(); + for (int i = 0; i < n; ++i) { + MethodInfo minfo = (MethodInfo)list.get(i); + if (minfo.getName().equals(methodName)) { + int res = compareSignature(minfo.getDescriptor(), argTypes, argDims, argClassNames); - if (res != NO) { - Method r = new Method(clazz, minfo, res); - if (res == YES) - return r; - else if (maybe == null || maybe.notmatch > res) - maybe = r; + if (res != NO) { + Method r = new Method(clazz, minfo, res); + if (res == YES) + return r; + else if (maybe == null || maybe.notmatch > res) + maybe = r; + } } } } |