aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/CtClassType.java
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2014-11-19 05:49:27 +0900
committerchibash <chiba@javassist.org>2014-11-19 05:49:27 +0900
commit0ba6f9efdc82e386e8716d8f2b1f25a1b95580a8 (patch)
treea026009c0c5399659b9c09f43643800d76a1eb05 /src/main/javassist/CtClassType.java
parenta0f4d935a20ffeefcfe4c66730ec702b7fff0928 (diff)
downloadjavassist-0ba6f9efdc82e386e8716d8f2b1f25a1b95580a8.tar.gz
javassist-0ba6f9efdc82e386e8716d8f2b1f25a1b95580a8.zip
for fixing JASSIST-236, I've added getDeclaredMethods(String) to CtClass.
Diffstat (limited to 'src/main/javassist/CtClassType.java')
-rw-r--r--src/main/javassist/CtClassType.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/javassist/CtClassType.java b/src/main/javassist/CtClassType.java
index 4df382a9..7ed43759 100644
--- a/src/main/javassist/CtClassType.java
+++ b/src/main/javassist/CtClassType.java
@@ -1205,6 +1205,20 @@ class CtClassType extends CtClass {
return cms;
}
+ public CtMethod[] getDeclaredMethods(String name) throws NotFoundException {
+ CtMember.Cache memCache = getMembers();
+ CtMember mth = memCache.methodHead();
+ CtMember mthTail = memCache.lastMethod();
+ ArrayList<CtMethod> methods = new ArrayList<CtMethod>();
+ while (mth != mthTail) {
+ mth = mth.next();
+ if (mth.getName().equals(name))
+ methods.add((CtMethod)mth);
+ }
+
+ return methods.toArray(new CtMethod[methods.size()]);
+ }
+
public CtMethod getDeclaredMethod(String name) throws NotFoundException {
CtMember.Cache memCache = getMembers();
CtMember mth = memCache.methodHead();