Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.IFNONNULL


                    if (check instanceof IF_ACMPNE || check instanceof IF_ACMPEQ) {
                        // need to update
                        head.swapInstruction(new NOP());
                        IfInstruction ifTest = (IfInstruction) check;
                        if (check instanceof IF_ACMPNE) {
                            next2.swapInstruction(new IFNONNULL(ifTest.getTarget()));
                        } else {
                            next2.swapInstruction(new IFNULL(ifTest.getTarget()));
                        }
                    }
                }
View Full Code Here


  }

  // Check if field is initialized (runtime)
  il.append(classGen.loadTranslet());
  il.append(new GETFIELD(fieldIndexes[_level]));
  final BranchHandle ifBlock1 = il.append(new IFNONNULL(null));

  // Create an instance of DefaultNodeCounter
  index = cpg.addMethodref(ClassNames[_level],
         "getDefaultNodeCounter",
         "(" + TRANSLET_INTF_SIG
View Full Code Here

                oidType = BCELClassEnhancer.OT_ObjectIdentity;
                oidKeyType = new ObjectType(Object.class.getName());
            }

            il.append(InstructionConstants.ALOAD_1);
            BranchInstruction checkKeyIsNull = new IFNONNULL(null);
            il.append(checkKeyIsNull);
            createThrowException(ClassEnhancer.CN_IllegalArgumentException, "key is null");
            checkKeyIsNull.setTarget(il.append(InstructionConstants.ALOAD_1));
            il.append(factory.createInstanceOf(Type.STRING));
            il.append(InstructionConstants.ICONST_1);
            BranchInstruction isInstanceof = new IF_ICMPEQ(null);
            il.append(isInstanceof);
View Full Code Here

        String oidClassName = cmd.getObjectidClass();
        if ((oidClassName != null) && (oidClassName.length() > 0))
        {
            ObjectType oidType = new ObjectType(oidClassName);
            il.append(InstructionConstants.ALOAD_1);
            BranchInstruction checkFmNotNull = new IFNONNULL(null);
            il.append(checkFmNotNull);
            createThrowException(ClassEnhancer.CN_IllegalArgumentException, "ObjectIdFieldConsumer is null");
            checkFmNotNull.setTarget(il.append(InstructionConstants.ALOAD_2));
            il.append(factory.createInstanceOf(oidType));

            BranchInstruction isInstanceof = new IFNE(null);
            il.append(isInstanceof);
            createThrowException(ClassEnhancer.CN_ClassCastException, "oid is not instanceof " + oidClassName);
View Full Code Here

        {
            // if (jdoStateManager != null)
            il.append(InstructionConstants.ALOAD_0);
            il.append(factory.createGetField(className, ClassEnhancer.FN_StateManager, BCELClassEnhancer.OT_StateManager));

            IFNONNULL ifnonnullSM = new IFNONNULL(null);
            il.append(ifnonnullSM);

            // jdoDetachedState != null
            il.append(InstructionConstants.ALOAD_0);
            il.append(factory.createGetField(className, ClassEnhancer.FN_JdoDetachedState, BCELClassEnhancer.OT_ObjectArray));

            IFNONNULL ifnonnullObjectId = new IFNONNULL(null);
            il.append(ifnonnullObjectId);

            il.append(InstructionConstants.ICONST_0);
            il.append(InstructionConstants.IRETURN);

            ifnonnullObjectId.setTarget(il.append(InstructionConstants.ICONST_1));
            il.append(InstructionConstants.IRETURN);

            // target
            InstructionHandle ifnonnullTarget = il.append(InstructionConstants.ICONST_0);
            ifnonnullSM.setTarget(ifnonnullTarget);
View Full Code Here

        else if ((oidClassName != null) && (oidClassName.length() > 0))
        {
            AbstractMemberMetaData targetFields[] = cmd.getManagedMembers();
            ObjectType oidType = new ObjectType(oidClassName);
            il.append(InstructionConstants.ALOAD_1);
            BranchInstruction checkFmNotNull = new IFNONNULL(null);
            il.append(checkFmNotNull);
            createThrowException(ClassEnhancer.CN_IllegalArgumentException, "ObjectIdFieldSupplier is null");
            checkFmNotNull.setTarget(il.append(InstructionConstants.ALOAD_2));
            il.append(factory.createInstanceOf(oidType));
            il.append(InstructionConstants.ICONST_1);
            BranchInstruction isInstanceof = new IF_ICMPEQ(null);
            il.append(isInstanceof);
            createThrowException(
View Full Code Here

        il.append(
            factory.createGetField(
                className,
                ClassEnhancer.FN_StateManager,
                BCELClassEnhancer.OT_StateManager));
        BranchInstruction smPresented = new IFNONNULL(null);
        il.append(smPresented);
        createThrowException(ClassEnhancer.CN_IllegalStateException, "state manager is null");

        smPresented.setTarget(il.append(InstructionConstants.ILOAD_1));
        if (cmd.getPersistenceCapableSuperclass() != null)
        {
            il.append(
                factory.createGetStatic(className, ClassEnhancer.FN_JdoInheritedFieldCount, Type.INT));
            il.append(InstructionConstants.ISUB);
View Full Code Here

        GOTO go[] = new GOTO[2];
        go[0] = new GOTO(null);
        go[1] = new GOTO(null);
        il.append(InstructionConstants.ALOAD_0);
        il.append(factory.createGetField(className, ClassEnhancer.FN_StateManager, BCELClassEnhancer.OT_StateManager));
        BranchInstruction hasStateManager = new IFNONNULL(null);
        il.append(hasStateManager);
        il.append(InstructionConstants.ALOAD_0);
        il.append(InstructionFactory.createLoad((Type)argTypes[1], 1));
        il.append(factory.createPutField(className, fieldName, (Type)argTypes[1]));
        il.append(go[0]);

        hasStateManager.setTarget(il.append(InstructionConstants.ALOAD_0));
        il.append(factory.createGetField(className, ClassEnhancer.FN_StateManager, BCELClassEnhancer.OT_StateManager));
        il.append(InstructionConstants.ALOAD_0);
        il.append(BCELUtils.getBIPUSH(fieldConfig.getFieldId()));
        if (cmd.getPersistenceCapableSuperclass() != null)
        {
View Full Code Here

        il.append(
            factory.createGetField(
                className,
                ClassEnhancer.FN_StateManager,
                BCELClassEnhancer.OT_StateManager));
        IFNONNULL smPresented = new IFNONNULL(null);
        il.append(smPresented);
        createThrowException(ClassEnhancer.CN_IllegalStateException, "state manager is null");

        smPresented.setTarget(il.append(InstructionConstants.ILOAD_1));
        if (cmd.getPersistenceCapableSuperclass() != null)
        {
            il.append(
                factory.createGetStatic(className, ClassEnhancer.FN_JdoInheritedFieldCount, Type.INT));
            il.append(InstructionConstants.ISUB);
View Full Code Here

        insList.insert(insFactory.createInvoke(STACK_CLASS, Constants.CONSTRUCTOR_NAME, Type.VOID, Type.NO_ARGS, Constants. INVOKESPECIAL));
        insList.insert(InstructionFactory.createDup(STACK_TYPE.getSize()));
        insList.insert(insFactory.createNew(STACK_TYPE));

        // test if no current continuation exists
        insList.insert(new IFNONNULL(restore_handle));
        insList.insert(InstructionFactory.createLoad(CONTINUATION_TYPE, method.getMaxLocals()));

        // get current continuation and store in the next to last local variable
        insList.insert(InstructionFactory.createStore(CONTINUATION_TYPE, method.getMaxLocals()));
        insList.insert(insFactory.createInvoke(CONTINUATION_CLASS, CONTINUATION_METHOD, CONTINUATION_TYPE,
View Full Code Here

TOP

Related Classes of org.apache.bcel.generic.IFNONNULL

Copyright © 2018 www.massapicom. 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.