git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@223 30ef5769-5b8d-40dd-aea6-55b5d6557bb3tags/rel_3_17_1_ga
@@ -169,11 +169,16 @@ public abstract class CtBehavior extends CtMember { | |||
} | |||
/** | |||
* Returns the character string representing the parameter types | |||
* and the return type. If two methods/constructors have | |||
* Returns the method signature (the parameter types | |||
* and the return type). | |||
* The method signature is represented by a character string | |||
* called method descriptor, which is defined in the JVM specification. | |||
* If two methods/constructors have | |||
* the same parameter types | |||
* and the return type, <code>getSignature()</code> returns the | |||
* same string (the return type of constructors is <code>void</code>). | |||
* | |||
* @see javassist.bytecode.Descriptor | |||
*/ | |||
public String getSignature() { | |||
return methodInfo.getDescriptor(); |
@@ -703,6 +703,7 @@ public abstract class CtClass { | |||
* | |||
* @param name method name | |||
* @param desc method descriptor | |||
* @see CtBehavior.getSignature() | |||
* @see javassist.bytecode.Descriptor | |||
*/ | |||
public CtMethod getMethod(String name, String desc) |
@@ -41,7 +41,7 @@ public class ConstructorCall extends MethodCall { | |||
* Returns the called constructor. | |||
*/ | |||
public CtConstructor getConstructor() throws NotFoundException { | |||
return getCtClass().getConstructor(getMethodDesc()); | |||
return getCtClass().getConstructor(getSignature()); | |||
} | |||
/** |
@@ -111,13 +111,20 @@ public class MethodCall extends Expr { | |||
* Returns the called method. | |||
*/ | |||
public CtMethod getMethod() throws NotFoundException { | |||
return getCtClass().getMethod(getMethodName(), getMethodDesc()); | |||
return getCtClass().getMethod(getMethodName(), getSignature()); | |||
} | |||
/** | |||
* Returns the descriptor of the called method. | |||
* Returns the method signature (the parameter types | |||
* and the return type). | |||
* The method signature is represented by a character string | |||
* called method descriptor, which is defined in the JVM specification. | |||
* | |||
* @see javassist.CtBehavior.getSignature() | |||
* @see javassist.bytecode.Descriptor | |||
* @since 3.1 | |||
*/ | |||
protected String getMethodDesc() { | |||
public String getSignature() { | |||
ConstPool cp = getConstPool(); | |||
int nt = getNameAndType(cp); | |||
return cp.getUtf8Info(cp.getNameAndTypeDescriptor(nt)); |