aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/expr/Expr.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/javassist/expr/Expr.java')
-rw-r--r--src/main/javassist/expr/Expr.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/javassist/expr/Expr.java b/src/main/javassist/expr/Expr.java
index b02d40e9..2764767d 100644
--- a/src/main/javassist/expr/Expr.java
+++ b/src/main/javassist/expr/Expr.java
@@ -35,7 +35,7 @@ public abstract class Expr implements Opcode {
static final String javaLangObject = "java.lang.Object";
- Expr(int pos, CodeIterator i, CtClass declaring, MethodInfo m) {
+ protected Expr(int pos, CodeIterator i, CtClass declaring, MethodInfo m) {
currentPos = pos;
iterator = i;
thisClass = declaring;
@@ -125,6 +125,16 @@ public abstract class Expr implements Opcode {
}
/**
+ * Returns the index of the bytecode corresponding to the
+ * expression.
+ * It is the index into the byte array containing the Java bytecode
+ * that implements the method.
+ */
+ public int indexOfBytecode() {
+ return currentPos;
+ }
+
+ /**
* Returns the line number of the source line containing the
* expression.
*