aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/bytecode/Descriptor.java
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2004-08-22 13:04:09 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2004-08-22 13:04:09 +0000
commit5d5407d0af21c23595e18aaae07eca9866e8f448 (patch)
treec1d52984266ff45282ac454cefc6cf5ab2f545a0 /src/main/javassist/bytecode/Descriptor.java
parent8c82477b4172ed0db9e5d866a0dba22ae20eb23f (diff)
downloadjavassist-5d5407d0af21c23595e18aaae07eca9866e8f448.tar.gz
javassist-5d5407d0af21c23595e18aaae07eca9866e8f448.zip
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
Diffstat (limited to 'src/main/javassist/bytecode/Descriptor.java')
-rw-r--r--src/main/javassist/bytecode/Descriptor.java15
1 files changed, 13 insertions, 2 deletions
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;
@@ -354,6 +356,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 <code>CtClass</code> object representing the return
* type specified by the given descriptor.
*