Examples of visitTypeInsn()


Examples of org.ow2.easybeans.asm.MethodVisitor.visitTypeInsn()

                mv.visitTypeInsn(CHECKCAST, "java/lang/RuntimeException");
                mv.visitInsn(ATHROW);

                // build Runtime exception with given exception
                mv.visitLabel(notInstanceOfRuntimeExceptionLabel);
                mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
                mv.visitInsn(DUP);
                mv.visitVarInsn(ALOAD, methodArg);
                mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>", "(Ljava/lang/Throwable;)V");
                mv.visitInsn(ATHROW);
View Full Code Here

Examples of org.ow2.easybeans.asm.MethodVisitor.visitTypeInsn()

        // Start of the Try label of Try/Catch
        Label tryLabel = new Label();
        mv.visitLabel(tryLabel);

        // build new object by calling the constructor
        mv.visitTypeInsn(NEW, genInvCtx.getGeneratedClassName());
        mv.visitInsn(DUP);

        // Add bean (as first argument)
        mv.visitVarInsn(ALOAD, 0);
View Full Code Here

Examples of org.ow2.easybeans.asm.MethodVisitor.visitTypeInsn()

            mv.visitLabel(catchsLabel[lastCatchBlockLabel]);
            mv.visitVarInsn(ASTORE, methodArg);

            // instanceof RuntimeException
            mv.visitVarInsn(ALOAD, methodArg);
            mv.visitTypeInsn(INSTANCEOF, "java/lang/RuntimeException");
            Label notInstanceOfRuntimeExceptionLabel = new Label();
            mv.visitJumpInsn(IFEQ, notInstanceOfRuntimeExceptionLabel);

            // throw existing runtime exception (by casting it)
            mv.visitVarInsn(ALOAD, methodArg);
View Full Code Here

Examples of org.ow2.easybeans.asm.MethodVisitor.visitTypeInsn()

            Label notInstanceOfRuntimeExceptionLabel = new Label();
            mv.visitJumpInsn(IFEQ, notInstanceOfRuntimeExceptionLabel);

            // throw existing runtime exception (by casting it)
            mv.visitVarInsn(ALOAD, methodArg);
            mv.visitTypeInsn(CHECKCAST, "java/lang/RuntimeException");
            mv.visitInsn(ATHROW);

            // build Runtime exception with given exception
            mv.visitLabel(notInstanceOfRuntimeExceptionLabel);
            mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
View Full Code Here

Examples of org.ow2.easybeans.asm.MethodVisitor.visitTypeInsn()

            mv.visitTypeInsn(CHECKCAST, "java/lang/RuntimeException");
            mv.visitInsn(ATHROW);

            // build Runtime exception with given exception
            mv.visitLabel(notInstanceOfRuntimeExceptionLabel);
            mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
            mv.visitInsn(DUP);
            mv.visitVarInsn(ALOAD, methodArg);
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>", "(Ljava/lang/Throwable;)V");
            mv.visitInsn(ATHROW);
View Full Code Here

Examples of org.ow2.easybeans.asm.MethodVisitor.visitTypeInsn()

            mv.visitLdcInsn(this.jMethod.getName());


            // build an array of java.lang.Class with the size of args of the method
            mv.visitIntInsn(BIPUSH, this.methodArgsType.length);
            mv.visitTypeInsn(ANEWARRAY, "java/lang/Class");
            int argCount = 0;
            for (Type type : this.methodArgsType) {
                mv.visitInsn(DUP);
                mv.visitIntInsn(BIPUSH, argCount);
                visitClassType(type, mv);
View Full Code Here

Examples of org.ow2.easybeans.asm.MethodVisitor.visitTypeInsn()

            //   throw new RuntimeException("Cannot...", e);
            // }
            Label firstCatchLabel = new Label();
            mv.visitLabel(firstCatchLabel);
            mv.visitVarInsn(ASTORE, 1);
            mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
            mv.visitInsn(DUP);
            mv.visitLdcInsn("Cannot find method due to a security exception");
            mv.visitVarInsn(ALOAD, 1);
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>",
                    "(Ljava/lang/String;Ljava/lang/Throwable;)V");
View Full Code Here

Examples of org.ow2.easybeans.asm.MethodVisitor.visitTypeInsn()

            //   throw new RuntimeException("Cannot...", e);
            // }
            Label secondCatchLabel = new Label();
            mv.visitLabel(secondCatchLabel);
            mv.visitVarInsn(ASTORE, 1);
            mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
            mv.visitInsn(DUP);
            mv.visitLdcInsn("Cannot find the method");
            mv.visitVarInsn(ALOAD, 1);
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>",
                    "(Ljava/lang/String;Ljava/lang/Throwable;)V");
View Full Code Here

Examples of org.ow2.easybeans.asm.MethodVisitor.visitTypeInsn()

        returnsObject(returnType, mv);


        // default case
        mv.visitLabel(defaultCaseLabel);
        mv.visitTypeInsn(NEW, "java/lang/IllegalStateException");
        mv.visitInsn(DUP);
        mv.visitLdcInsn("Problem in interceptors. Shouldn't go in the default case.");
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/IllegalStateException", "<init>", "(Ljava/lang/String;)V");
        mv.visitInsn(ATHROW);
View Full Code Here

Examples of org.ow2.easybeans.asm.MethodVisitor.visitTypeInsn()

            Label elseLabel = new Label();
            mv.visitJumpInsn(IFNONNULL, elseLabel);

            // if
            mv.visitVarInsn(ALOAD, 0);
            mv.visitTypeInsn(NEW, "java/util/HashMap");
            mv.visitInsn(DUP);
            mv.visitMethodInsn(INVOKESPECIAL, "java/util/HashMap", "<init>", "()V");
            mv.visitFieldInsn(PUTFIELD, this.generatedClassName, "contextData", "Ljava/util/Map;");

            // else
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.