diff options
author | chibash <chiba@javassist.org> | 2014-11-18 15:43:31 +0900 |
---|---|---|
committer | chibash <chiba@javassist.org> | 2014-11-18 15:43:31 +0900 |
commit | a0f4d935a20ffeefcfe4c66730ec702b7fff0928 (patch) | |
tree | 397f4fda3ebba38bc3c83bb29f087a8caf5b4ab2 /src/test/Test.java | |
parent | c988383c3921bfd26139c54d6ad4e8f95c48fa0f (diff) | |
download | javassist-a0f4d935a20ffeefcfe4c66730ec702b7fff0928.tar.gz javassist-a0f4d935a20ffeefcfe4c66730ec702b7fff0928.zip |
fixed JASSIST-235. Now CtClass.getEnclosingMethod() is deprecated due to its potential bug.
Diffstat (limited to 'src/test/Test.java')
-rw-r--r-- | src/test/Test.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/Test.java b/src/test/Test.java index 83fe2954..a6d31c68 100644 --- a/src/test/Test.java +++ b/src/test/Test.java @@ -8,7 +8,9 @@ public class Test { } ClassPool cp = ClassPool.getDefault(); - CtClass str = cp.get("java.lang.String"); + CtClass inner3 = cp.get("test2.Anon$Anon2.1"); + CtBehavior ct = inner3.getEnclosingBehavior(); +/* CtClass str = cp.get("java.lang.String"); CtClass cc = cp.get("Test"); cc.getClassFile().setMajorVersion(javassist.bytecode.ClassFile.JAVA_4); CtMethod m = cc.getDeclaredMethod("bar"); @@ -16,7 +18,7 @@ public class Test { m.insertAfter(" dismiss( aVar );" , true); cc.getClassFile().setMajorVersion(javassist.bytecode.ClassFile.JAVA_7); m.insertBefore("aVar = initVar();"); - cc.writeFile(); + cc.writeFile();*/ } public void bar(int i) { foo(i); } |