summaryrefslogtreecommitdiffstats
path: root/src/main/javassist/expr/Expr.java
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2006-04-09 15:11:11 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2006-04-09 15:11:11 +0000
commiteee86c9995badd1bb12a3b01ceb0189cfa141c95 (patch)
tree748b4110ed615912d0f4c1a63102dd9a6bd22b1c /src/main/javassist/expr/Expr.java
parent7b68913ebbbdc6d7f7e48b18e7d7e5ffc6667527 (diff)
downloadjavassist-eee86c9995badd1bb12a3b01ceb0189cfa141c95.tar.gz
javassist-eee86c9995badd1bb12a3b01ceb0189cfa141c95.zip
fixed a bug of replace(String,ExprEditor) in javassist.expr.Expr.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@267 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/expr/Expr.java')
-rw-r--r--src/main/javassist/expr/Expr.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/javassist/expr/Expr.java b/src/main/javassist/expr/Expr.java
index c6cf78eb..e2d455f2 100644
--- a/src/main/javassist/expr/Expr.java
+++ b/src/main/javassist/expr/Expr.java
@@ -301,14 +301,13 @@ public abstract class Expr implements Opcode {
codeAttr.setMaxLocals(newLocals);
ExprEditor.LoopContext context
= new ExprEditor.LoopContext(newLocals);
- CodeIterator iterator = codeAttr.iterator();
- iterator.move(currentPos);
- int size = iterator.getCodeLength();
+ int size = oldIterator.getCodeLength();
int endPos = oldIterator.lookAhead();
- if (ed.doit(thisClass, thisMethod, context, iterator, endPos))
+ oldIterator.move(currentPos);
+ if (ed.doit(thisClass, thisMethod, context, oldIterator, endPos))
edited = true;
- oldIterator.move(endPos + iterator.getCodeLength() - size);
+ oldIterator.move(endPos + oldIterator.getCodeLength() - size);
codeAttr.setMaxLocals(orgLocals);
codeAttr.setMaxStack(orgStack);
maxLocals = context.maxLocals;