Browse Source

Allow access to the constructor signature.


git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@245 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
tags/rel_3_17_1_ga
adrian 18 years ago
parent
commit
f280738536
1 changed files with 17 additions and 2 deletions
  1. 17
    2
      src/main/javassist/expr/NewExpr.java

+ 17
- 2
src/main/javassist/expr/NewExpr.java View File

newPos = np; newPos = np;
} }


/*
* Not used
*
private int getNameAndType(ConstPool cp) { private int getNameAndType(ConstPool cp) {
int pos = currentPos; int pos = currentPos;
int c = iterator.byteAt(pos); int c = iterator.byteAt(pos);
return cp.getInterfaceMethodrefNameAndType(index); return cp.getInterfaceMethodrefNameAndType(index);
else else
return cp.getMethodrefNameAndType(index); return cp.getMethodrefNameAndType(index);
}
} */


/** /**
* Returns the method or constructor containing the <tt>new</tt> * Returns the method or constructor containing the <tt>new</tt>
return newTypeName; return newTypeName;
} }


/**
* Get the signature of the constructor
*
* @return the signature
*/
public String getSignature()
{
ConstPool constPool = getConstPool();
int methodIndex = iterator.u16bitAt(currentPos + 1); // constructor
return constPool.getMethodrefType(methodIndex);
}

/** /**
* Returns the constructor called for creating the object. * Returns the constructor called for creating the object.
*/ */
throw new CannotCompileException( throw new CannotCompileException(
"sorry, cannot edit NEW followed by no DUP"); "sorry, cannot edit NEW followed by no DUP");
} }
/** /**
* Replaces the <tt>new</tt> expression with the bytecode derived from * Replaces the <tt>new</tt> expression with the bytecode derived from
* the given source text. * the given source text.

Loading…
Cancel
Save