]> source.dussan.org Git - javassist.git/commitdiff
fixed JASSIST-195
authorchibash <chiba@javassist.org>
Mon, 27 May 2013 10:21:04 +0000 (19:21 +0900)
committerchibash <chiba@javassist.org>
Mon, 27 May 2013 10:21:04 +0000 (19:21 +0900)
src/test/test4/JIRA195.java [new file with mode: 0644]

diff --git a/src/test/test4/JIRA195.java b/src/test/test4/JIRA195.java
new file mode 100644 (file)
index 0000000..13b91d1
--- /dev/null
@@ -0,0 +1,31 @@
+package test4;
+
+import javassist.ClassPool;
+import javassist.CtClass;
+import javassist.CtMethod;
+
+public class JIRA195 {
+    public int run() { return test(3); }
+
+    public int test(int i) {
+        try {}
+        catch (Throwable t) {}
+        finally {
+            i = incByOne(i);
+        }
+
+        return i;
+    }
+
+    private int incByOne(int i) {
+        return i + 1;
+    }
+
+    public static void main(String[] args) throws Exception {
+        ClassPool cp = new ClassPool();
+        cp.appendClassPath("./target/test-classes");
+        CtClass cc = cp.get("test4.JIRA195");
+        CtMethod mth = cc.getDeclaredMethod("test");
+        mth.getMethodInfo().rebuildStackMap(cc.getClassPool());
+    }
+}