diff options
author | chibash <chiba@javassist.org> | 2014-11-20 22:57:52 +0900 |
---|---|---|
committer | chibash <chiba@javassist.org> | 2014-11-20 22:57:52 +0900 |
commit | 07c2e6440fcd9136e9dfcae08497edefe66a9bc9 (patch) | |
tree | 1f9df7e39065e2564c64698d8b50a5badd29787a /src/test/javassist/JvstTest4.java | |
parent | 0ba6f9efdc82e386e8716d8f2b1f25a1b95580a8 (diff) | |
download | javassist-07c2e6440fcd9136e9dfcae08497edefe66a9bc9.tar.gz javassist-07c2e6440fcd9136e9dfcae08497edefe66a9bc9.zip |
fixed JASSIST-208
Diffstat (limited to 'src/test/javassist/JvstTest4.java')
-rw-r--r-- | src/test/javassist/JvstTest4.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/javassist/JvstTest4.java b/src/test/javassist/JvstTest4.java index 13784fd7..2a60af8b 100644 --- a/src/test/javassist/JvstTest4.java +++ b/src/test/javassist/JvstTest4.java @@ -181,15 +181,19 @@ public class JvstTest4 extends JvstTestRoot { ClassFileWriter.MethodWriter mw = cfw.getMethodWriter(); mw.begin(AccessFlag.PUBLIC, MethodInfo.nameInit, "()V", null, null); + assertEquals(0, mw.size()); mw.add(Opcode.ALOAD_0); + assertEquals(1, mw.size()); mw.addInvoke(Opcode.INVOKESPECIAL, "java/lang/Object", MethodInfo.nameInit, "()V"); mw.add(Opcode.RETURN); mw.codeEnd(1, 1); mw.end(null, null); mw.begin(AccessFlag.PUBLIC, "move", "(II)V", null, null); + assertEquals(0, mw.size()); mw.add(Opcode.ALOAD_0); mw.addInvoke(Opcode.INVOKEVIRTUAL, "java/lang/Object", "toString", "()Ljava/lang/String;"); + assertEquals(4, mw.size()); mw.add(Opcode.POP); mw.add(Opcode.RETURN); mw.add(Opcode.POP); @@ -1065,6 +1069,7 @@ public class JvstTest4 extends JvstTestRoot { AnnotationsAttribute attr = new AnnotationsAttribute(cp, AnnotationsAttribute.visibleTag); Annotation a = new Annotation(anno.getName(), cp); + a.addMemberValue("value", new javassist.bytecode.annotation.StringMemberValue("file/path", cp)); attr.setAnnotation(a); m.getMethodInfo().addAttribute(attr); cc.writeFile(); |