From 5d5407d0af21c23595e18aaae07eca9866e8f448 Mon Sep 17 00:00:00 2001 From: chiba Date: Sun, 22 Aug 2004 13:04:09 +0000 Subject: fixed a bug in CtClass.getMethods() and javassist.reflect package git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@126 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/bytecode/Descriptor.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/main/javassist/bytecode/Descriptor.java') diff --git a/src/main/javassist/bytecode/Descriptor.java b/src/main/javassist/bytecode/Descriptor.java index 4a352aaf..54ee506b 100644 --- a/src/main/javassist/bytecode/Descriptor.java +++ b/src/main/javassist/bytecode/Descriptor.java @@ -337,9 +337,11 @@ public class Descriptor { } /** - * Returns true if desc1 and desc2 has the same signature. + * Returns true if the list of the parameter types of desc1 is equal to + * that of desc2. + * For example, "(II)V" and "(II)I" are equal. */ - public static boolean eqSignature(String desc1, String desc2) { + public static boolean eqParamTypes(String desc1, String desc2) { if (desc1.charAt(0) != '(') return false; @@ -353,6 +355,15 @@ public class Descriptor { } } + /** + * Returns the signature of the given descriptor. The signature does + * not include the return type. For example, the signature of "(I)V" + * is "(I)". + */ + public static String getParamDescriptor(String decl) { + return decl.substring(0, decl.indexOf(')') + 1); + } + /** * Returns the CtClass object representing the return * type specified by the given descriptor. -- cgit v1.2.3