aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/expr
diff options
context:
space:
mode:
authoradrian <adrian@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2006-02-15 14:55:59 +0000
committeradrian <adrian@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2006-02-15 14:55:59 +0000
commitf280738536267d7ec1f6de1052861007a16a794a (patch)
tree0f71aca56529e50b8cb400c1cef3ff15c605bf47 /src/main/javassist/expr
parent99ab9359c46e0d21ac5e4055fca235f064c64934 (diff)
downloadjavassist-f280738536267d7ec1f6de1052861007a16a794a.tar.gz
javassist-f280738536267d7ec1f6de1052861007a16a794a.zip
Allow access to the constructor signature.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@245 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/expr')
-rw-r--r--src/main/javassist/expr/NewExpr.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main/javassist/expr/NewExpr.java b/src/main/javassist/expr/NewExpr.java
index a75a0a5c..835485f5 100644
--- a/src/main/javassist/expr/NewExpr.java
+++ b/src/main/javassist/expr/NewExpr.java
@@ -37,6 +37,9 @@ public class NewExpr extends Expr {
newPos = np;
}
+ /*
+ * Not used
+ *
private int getNameAndType(ConstPool cp) {
int pos = currentPos;
int c = iterator.byteAt(pos);
@@ -46,7 +49,7 @@ public class NewExpr extends Expr {
return cp.getInterfaceMethodrefNameAndType(index);
else
return cp.getMethodrefNameAndType(index);
- }
+ } */
/**
* Returns the method or constructor containing the <tt>new</tt>
@@ -88,6 +91,18 @@ public class NewExpr extends Expr {
}
/**
+ * 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.
*/
public CtConstructor getConstructor() throws NotFoundException {
@@ -131,7 +146,7 @@ public class NewExpr extends Expr {
throw new CannotCompileException(
"sorry, cannot edit NEW followed by no DUP");
}
-
+
/**
* Replaces the <tt>new</tt> expression with the bytecode derived from
* the given source text.