Examples of visitJumpInsn()


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

            // if the factory is not null, skip the code and go the easyBeansFactoryNotNullLabel label
            Label easyBeansFactoryNotNullLabel = new Label();
            mv.visitVarInsn(ALOAD, 0);
            mv.visitMethodInsn(INVOKEVIRTUAL, this.classAnnotationMetadata.getClassName(), "getEasyBeansFactory", "()Lorg/ow2/easybeans/api/Factory;");
            mv.visitJumpInsn(IFNONNULL, easyBeansFactoryNotNullLabel);

            // factory is null, needs to call the original/renamed method
            Type[] args = Type.getArgumentTypes(method.getJMethod().getDescriptor());
            mv.visitVarInsn(ALOAD, 0);
View Full Code Here

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

            mv.visitVarInsn(ALOAD, 0);
            // Test if invocation context factory is null
            // If there is no invocation context factory, jump to the end
            mv.visitMethodInsn(INVOKEVIRTUAL, this.classAnnotationMetadata.getClassName(), "getEasyBeansInvocationContextFactory", "()Lorg/ow2/easybeans/api/interceptor/EZBInvocationContextFactory;");
            Label labelNoInvocationContextFactory = new Label();
            mv.visitJumpInsn(IFNULL, labelNoInvocationContextFactory);

            // Begin of the try block
            mv.visitLabel(tryLabelStart);
            mv.visitVarInsn(ALOAD, 0);
View Full Code Here

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

                // 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);
                mv.visitTypeInsn(CHECKCAST, "java/lang/RuntimeException");
                mv.visitInsn(ATHROW);
View Full Code Here

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

            // 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);
            mv.visitTypeInsn(CHECKCAST, "java/lang/RuntimeException");
            mv.visitInsn(ATHROW);
View Full Code Here

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

            // if (method == null) {
            mv.visitFieldInsn(GETSTATIC, this.generatedClassName, "method", JAVA_LANG_REFLECT_METHOD);
            // go to this label if not null
            Label notNullParametersLabel = new Label();
            mv.visitJumpInsn(IFNONNULL, notNullParametersLabel);


            // Start of the try block
            Label tryLabel = new Label();
            mv.visitLabel(tryLabel);
View Full Code Here

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

            // set the result : method = ...
            mv.visitFieldInsn(PUTSTATIC, this.generatedClassName, "method", "Ljava/lang/reflect/Method;");


            // go to the return label
            mv.visitJumpInsn(GOTO, notNullParametersLabel);

            // start of the catch label which throw a runtime exception
            // } catch (SecurityException e) {
            //   throw new RuntimeException("Cannot...", e);
            // }
View Full Code Here

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

            mv.visitCode();
            mv.visitVarInsn(ALOAD, 0);
            mv.visitFieldInsn(GETFIELD, this.generatedClassName, "contextData", "Ljava/util/Map;");

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

            // if
            mv.visitVarInsn(ALOAD, 0);
            mv.visitTypeInsn(NEW, "java/util/HashMap");
            mv.visitInsn(DUP);
View Full Code Here

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

            // if (parameters == null) {
            mv.visitVarInsn(ALOAD, 0);
            mv.visitFieldInsn(GETFIELD, this.generatedClassName, "parameters", ARRAY_OBJECTS);
            // go to this label if not null
            Label notNullParametersLabel = new Label();
            mv.visitJumpInsn(IFNONNULL, notNullParametersLabel);

            // parameters = new Object[] {arg0, arg1, arg...};
            // put size of the array
            mv.visitVarInsn(ALOAD, 0);
            mv.visitIntInsn(BIPUSH, this.methodArgsType.length);
View Full Code Here

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

             * if (aobj == null) { throw new IllegalStateException("Cannot set a
             * null array."); }
             */
            mv.visitVarInsn(ALOAD, 1);
            Label notNull = new Label();
            mv.visitJumpInsn(IFNONNULL, notNull);
            mv.visitTypeInsn(NEW, "java/lang/IllegalStateException");
            mv.visitInsn(DUP);
            mv.visitLdcInsn("Cannot set a null array.");
            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.visitJumpInsn()

             */
            mv.visitVarInsn(ALOAD, 1);
            mv.visitInsn(ARRAYLENGTH);
            mv.visitIntInsn(BIPUSH, this.methodArgsType.length);
            Label sizeOk = new Label();
            mv.visitJumpInsn(IF_ICMPEQ, sizeOk);
            mv.visitTypeInsn(NEW, "java/lang/IllegalStateException");
            mv.visitInsn(DUP);
            mv.visitLdcInsn("Invalid size of the given array. The length should be '" + this.methodArgsType.length + "'.");
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/IllegalStateException", "<init>", "(Ljava/lang/String;)V");
            mv.visitInsn(ATHROW);
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.