diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2013-04-14 15:58:54 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2013-04-14 15:58:54 +0000 |
commit | 81e75232f4deaf5c9d45a4956d87a37f03722ca9 (patch) | |
tree | c7c5df3a3c62f365668adb7bd8f5c1b147269010 | |
parent | fc4e2231b33404adea225df5a931db62619b1b12 (diff) | |
download | javassist-81e75232f4deaf5c9d45a4956d87a37f03722ca9.tar.gz javassist-81e75232f4deaf5c9d45a4956d87a37f03722ca9.zip |
fixed JASSIST-185
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@704 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
-rw-r--r-- | Readme.html | 4 | ||||
-rw-r--r-- | javassist.jar | bin | 680010 -> 681159 bytes | |||
-rw-r--r-- | src/main/javassist/CtBehavior.java | 8 | ||||
-rw-r--r-- | src/main/javassist/bytecode/CodeAttribute.java | 2 | ||||
-rw-r--r-- | src/test/javassist/JvstTest4.java | 8 | ||||
-rw-r--r-- | src/test/test4/Lvtt.java | 11 |
6 files changed, 29 insertions, 4 deletions
diff --git a/Readme.html b/Readme.html index a123d0f5..25d15562 100644 --- a/Readme.html +++ b/Readme.html @@ -7,7 +7,7 @@ <h1>Javassist version 3</h1> -<h3>Copyright (C) 1999-2012 by Shigeru Chiba, All rights reserved.</h3> +<h3>Copyright (C) 1999-2013 by Shigeru Chiba, All rights reserved.</h3> <p><br></p> @@ -283,7 +283,7 @@ see javassist.Dump. <p>-version 3.18 <ul> -JIRA JASSIST-183, 184, 189, 162, 186, 190. +JIRA JASSIST-183, 184, 189, 162, 185, 186, 190. </ul> <p>-version 3.17.1 on December 3, 2012 diff --git a/javassist.jar b/javassist.jar Binary files differindex 8ff2f083..784fab0e 100644 --- a/javassist.jar +++ b/javassist.jar diff --git a/src/main/javassist/CtBehavior.java b/src/main/javassist/CtBehavior.java index 73ac277a..92513159 100644 --- a/src/main/javassist/CtBehavior.java +++ b/src/main/javassist/CtBehavior.java @@ -656,11 +656,15 @@ public abstract class CtBehavior extends CtMember { ca.insertLocalVar(where, size); LocalVariableAttribute va - = (LocalVariableAttribute) - ca.getAttribute(LocalVariableAttribute.tag); + = (LocalVariableAttribute)ca.getAttribute(LocalVariableAttribute.tag); if (va != null) va.shiftIndex(where, size); + LocalVariableTypeAttribute lvta + = (LocalVariableTypeAttribute)ca.getAttribute(LocalVariableTypeAttribute.tag); + if (lvta != null) + lvta.shiftIndex(where, size); + StackMapTable smt = (StackMapTable)ca.getAttribute(StackMapTable.tag); if (smt != null) smt.insertLocal(where, StackMapTable.typeTagOf(typeDesc), classInfo); diff --git a/src/main/javassist/bytecode/CodeAttribute.java b/src/main/javassist/bytecode/CodeAttribute.java index dbf714e7..090ae74d 100644 --- a/src/main/javassist/bytecode/CodeAttribute.java +++ b/src/main/javassist/bytecode/CodeAttribute.java @@ -465,6 +465,7 @@ public class CodeAttribute extends AttributeInfo implements Opcode { * Changes the index numbers of the local variables * to append a new parameter. * This method does not update <code>LocalVariableAttribute</code>, + * <code>LocalVariableTypeAttribute</code>, * <code>StackMapTable</code>, or <code>StackMap</code>. * These attributes must be explicitly updated. * @@ -472,6 +473,7 @@ public class CodeAttribute extends AttributeInfo implements Opcode { * @param size the type size of the new parameter (1 or 2). * * @see LocalVariableAttribute#shiftIndex(int, int) + * @see LocalVariableTypeAttribute#shiftIndex(int, int) * @see StackMapTable#insertLocal(int, int, int) * @see StackMap#insertLocal(int, int, int) */ diff --git a/src/test/javassist/JvstTest4.java b/src/test/javassist/JvstTest4.java index 7692d5bc..619b9e97 100644 --- a/src/test/javassist/JvstTest4.java +++ b/src/test/javassist/JvstTest4.java @@ -838,4 +838,12 @@ public class JvstTest4 extends JvstTestRoot { Object obj = make(cc.getName()); assertEquals(12, invoke(obj, "test1")); } + + public void testLocalVariableTypeTable() throws Exception { + CtClass cc = sloader.get("test4.Lvtt"); + CtMethod m = cc.getDeclaredMethod("run"); + m.addParameter(CtClass.intType); + cc.writeFile(); + Object obj = make(cc.getName()); + } } diff --git a/src/test/test4/Lvtt.java b/src/test/test4/Lvtt.java new file mode 100644 index 00000000..b9d72c53 --- /dev/null +++ b/src/test/test4/Lvtt.java @@ -0,0 +1,11 @@ +package test4; + +import java.util.ArrayList; +import java.util.List; + +public class Lvtt { + public void run() { + List<String> s = new ArrayList<String>(); + System.out.println(s); + } +} |