From 82948b782b92e8c1c2b7870e2abc313c298a2609 Mon Sep 17 00:00:00 2001 From: chibash Date: Mon, 27 May 2013 19:21:04 +0900 Subject: fixed JASSIST-195 --- src/test/test4/JIRA195.java | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/test/test4/JIRA195.java (limited to 'src') diff --git a/src/test/test4/JIRA195.java b/src/test/test4/JIRA195.java new file mode 100644 index 00000000..13b91d13 --- /dev/null +++ b/src/test/test4/JIRA195.java @@ -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()); + } +} -- cgit v1.2.3