*/
public class OptimizeJumpTransformerTest extends AbstractTestCase {
public void test() {
TraceMethodVisitor tmv = new TraceMethodVisitor(null);
MethodNode mn = new MethodNode(0, null, null, null, null);
mn.visitCode();
mn.visitVarInsn(ILOAD, 1);
Label label = new Label();
mn.visitJumpInsn(IFLT, label);
mn.visitVarInsn(ALOAD, 0);
mn.visitVarInsn(ILOAD, 1);
mn.visitFieldInsn(PUTFIELD, "pkg/Bean", "f", "I");
Label end = new Label();
mn.visitJumpInsn(GOTO, end);
mn.visitLabel(label);
mn.visitFrame(F_SAME, 0, null, 0, null);
mn.visitTypeInsn(NEW, "java/lang/IllegalArgumentException");
mn.visitInsn(DUP);
mn.visitMethodInsn(INVOKESPECIAL,
"java/lang/IllegalArgumentException", "<init>", "()V");
mn.visitInsn(ATHROW);
mn.visitLabel(end);
mn.visitFrame(F_SAME, 0, null, 0, null);
mn.visitInsn(RETURN);
mn.visitMaxs(0, 0);
mn.visitEnd();
new OptimizeJumpTransformer(null).transform(mn);
mn.accept(tmv);
checkMethod(tmv);
}