summaryrefslogtreecommitdiffstats
path: root/src/test/Jassist150.java
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-02-19 12:41:47 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-02-19 12:41:47 +0000
commite50d7c0862acc66ca1d6b26ec126eb3ed5295d7d (patch)
treea469d5da08dc4ad80401739f827974606ac8621b /src/test/Jassist150.java
parent205b65d96c5fb9d0086eb98d31e21e927d79cf27 (diff)
downloadjavassist-e50d7c0862acc66ca1d6b26ec126eb3ed5295d7d.tar.gz
javassist-e50d7c0862acc66ca1d6b26ec126eb3ed5295d7d.zip
fixed JASSIST-152
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@615 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/test/Jassist150.java')
-rw-r--r--src/test/Jassist150.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/test/Jassist150.java b/src/test/Jassist150.java
index 1435e274..d3945069 100644
--- a/src/test/Jassist150.java
+++ b/src/test/Jassist150.java
@@ -3,6 +3,8 @@ import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import javassist.NotFoundException;
+import javassist.expr.ExprEditor;
+import javassist.expr.MethodCall;
public class Jassist150 {
public static final String BASE_PATH = "./";
@@ -77,7 +79,23 @@ public class Jassist150 {
ccGet.setBody(code3);
}
- public static void main(String[] args) {
+ public void testJIRA152() throws Exception {
+ CtClass cc = ClassPool.getDefault().get("test4.JIRA152");
+ CtMethod mth = cc.getDeclaredMethod("buildColumnOverride");
+ mth.instrument(new ExprEditor() {
+ public void edit(MethodCall c) throws CannotCompileException {
+ c.replace("try{ $_ = $proceed($$); } catch (Throwable t) { throw t; }");
+ }
+ });
+ mth.getMethodInfo().rebuildStackMap(ClassPool.getDefault());
+ cc.writeFile();
+ }
+
+ public static void main(String[] args) throws Exception {
+ new Jassist150().testJIRA152();
+ }
+
+ public static void main2(String[] args) {
for (int loop = 0; loop < 5; loop++) {
try {
implTestClassTailCache();