Преглед на файлове

implemented getSignature() in javassist.expr.MethodCall


git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@223 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
tags/rel_3_17_1_ga
chiba преди 18 години
родител
ревизия
549aab4f06
променени са 4 файла, в които са добавени 19 реда и са изтрити 6 реда
  1. 7
    2
      src/main/javassist/CtBehavior.java
  2. 1
    0
      src/main/javassist/CtClass.java
  3. 1
    1
      src/main/javassist/expr/ConstructorCall.java
  4. 10
    3
      src/main/javassist/expr/MethodCall.java

+ 7
- 2
src/main/javassist/CtBehavior.java Целия файл

@@ -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();

+ 1
- 0
src/main/javassist/CtClass.java Целия файл

@@ -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)

+ 1
- 1
src/main/javassist/expr/ConstructorCall.java Целия файл

@@ -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());
}

/**

+ 10
- 3
src/main/javassist/expr/MethodCall.java Целия файл

@@ -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));

Loading…
Отказ
Запис