Package org.ow2.asm

Examples of org.ow2.asm.MethodVisitor.visitTableSwitchInsn()


        // tableswitch
        Label l1 = new Label();
        Label l2 = new Label();
        Label l3 = new Label();
        mv.visitVarInsn(ILOAD, 1);
        mv.visitTableSwitchInsn(0, 2, l3/*default*/, l1, l2, l3 );
        mv.visitLabel(l1);
        mv.visitInsn(ICONST_1);
        mv.visitVarInsn(ISTORE, 7);
        mv.visitJumpInsn(GOTO, l3);
        mv.visitLabel(l2);
View Full Code Here


    public void testIllegalTableSwitchParameters1() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitTableSwitchInsn(1, 0, new Label(), new Label[0]);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalTableSwitchParameters2() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitTableSwitchInsn(0, 1, null, new Label[0]);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalTableSwitchParameters3() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitTableSwitchInsn(0, 1, new Label(), (Label[])null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalTableSwitchParameters4() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitTableSwitchInsn(0, 1, new Label(), new Label[0]);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

        // default label
        Label defaultCaseLabel = new Label();

        // switch
        mv.visitTableSwitchInsn(1, switchSize, defaultCaseLabel, switchLabels);

        // add each interceptor switch entry with a return block at the end
        // ie : case 1 :
        //        return myInterceptor.intercept(this); // interceptor class
        // or case 1 :
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.