aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/bytecode/LocalVariableAttribute.java
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2008-05-01 10:47:59 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2008-05-01 10:47:59 +0000
commit664bfcc3db3aa02fb9abfc799de8ff274dd6f1da (patch)
tree64a85bb9d98e954262f9608ce64f7a1e005cd89d /src/main/javassist/bytecode/LocalVariableAttribute.java
parentbd6d4dcb4cc5a68c9c4d79d640567fd8b5cd8279 (diff)
downloadjavassist-664bfcc3db3aa02fb9abfc799de8ff274dd6f1da.tar.gz
javassist-664bfcc3db3aa02fb9abfc799de8ff274dd6f1da.zip
fixed JASSIST-47 and 60.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@435 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/bytecode/LocalVariableAttribute.java')
-rw-r--r--src/main/javassist/bytecode/LocalVariableAttribute.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/LocalVariableAttribute.java b/src/main/javassist/bytecode/LocalVariableAttribute.java
index 54929137..80f96533 100644
--- a/src/main/javassist/bytecode/LocalVariableAttribute.java
+++ b/src/main/javassist/bytecode/LocalVariableAttribute.java
@@ -92,6 +92,22 @@ public class LocalVariableAttribute extends AttributeInfo {
}
/**
+ * For each <code>local_variable_table[i].index</code>,
+ * this method increases <code>index</code> by <code>delta</code>.
+ *
+ * @param lessThan the index does not change if it
+ * is less than this value.
+ */
+ public void shiftIndex(int lessThan, int delta) {
+ int size = info.length;
+ for (int i = 2; i < size; i += 10){
+ int org = ByteArray.readU16bit(info, i + 8);
+ if (org >= lessThan)
+ ByteArray.write16bit(org + delta, info, i + 8);
+ }
+ }
+
+ /**
* Returns <code>local_variable_table_length</code>.
* This represents the number of entries in the table.
*/