Examples of statements()


Examples of org.eclipse.jdt.core.dom.Block.statements()

                if (isFinal) {
                    if ((_getAccessedField(currentClass.getName(), fieldName) != null)
                            || !Type.isPrimitive(Type.getElementType(fieldType
                                    .getName()))) {
                        body.statements().add(
                                ast.newExpressionStatement(restoreMethodCall));
                    }
                } else {
                    Expression rightHandSide;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

                    }

                    Assignment assignment = ast.newAssignment();
                    assignment.setLeftHandSide(ast.newSimpleName(fieldName));
                    assignment.setRightHandSide(rightHandSide);
                    body.statements().add(
                            ast.newExpressionStatement(assignment));
                }
            }

            // Add a call to the restore method in the superclass, if necessary.
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

            if ((parent != null)
                    && (state.getCrossAnalyzedTypes()
                            .contains(parent.getName()) || hasMethod(parent,
                            methodName,
                            new Class[] { int.class, boolean.class }))) {
                body.statements().add(superRestoreStatement);
            } else {
                // Restore the previous checkpoint, if necessary.
                IfStatement restoreCheckpoint = ast.newIfStatement();

                InfixExpression timestampTester = ast.newInfixExpression();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

                restoreCheckpointInvocation.arguments().add(
                        ast.newSimpleName("timestamp"));
                restoreCheckpointInvocation.arguments().add(
                        ast.newSimpleName("trim"));
                assignCheckpoint.setRightHandSide(restoreCheckpointInvocation);
                restoreBlock.statements().add(
                        ast.newExpressionStatement(assignCheckpoint));

                // Pop the old states.
                MethodInvocation popStates = ast.newMethodInvocation();
                String recordType = getClassName(FieldRecord.class, state, root);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

                MethodInvocation popStates = ast.newMethodInvocation();
                String recordType = getClassName(FieldRecord.class, state, root);
                popStates.setExpression(createName(ast, recordType));
                popStates.setName(ast.newSimpleName("popState"));
                popStates.arguments().add(ast.newSimpleName(RECORDS_NAME));
                restoreBlock.statements().add(
                        ast.newExpressionStatement(popStates));

                // Recall the restore method.
                MethodInvocation recursion = ast.newMethodInvocation();
                recursion.setName(ast.newSimpleName(methodName));
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

                // Recall the restore method.
                MethodInvocation recursion = ast.newMethodInvocation();
                recursion.setName(ast.newSimpleName(methodName));
                recursion.arguments().add(ast.newSimpleName("timestamp"));
                recursion.arguments().add(ast.newSimpleName("trim"));
                restoreBlock.statements().add(
                        ast.newExpressionStatement(recursion));

                body.statements().add(restoreCheckpoint);

                if (parent != null) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

        MethodInvocation setCheckpoint = ast.newMethodInvocation();
        setCheckpoint.setExpression(ast.newSimpleName("newValue"));
        setCheckpoint.setName(ast.newSimpleName(SET_CHECKPOINT_NAME));
        setCheckpoint.arguments().add(ast.newSimpleName(CHECKPOINT_NAME));
        thenBranch.statements().add(ast.newExpressionStatement(setCheckpoint));

        return ifStatement;
    }

    /** Create a set checkpoint method for a class, which sets its checkpoint
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

            // The "then" branch of the test.
            Block thenBranch = ast.newBlock();
            test.setThenStatement(thenBranch);

            Block body = ast.newBlock();
            body.statements().add(test);
            method.setBody(body);

            // Backup the old checkpoint.
            VariableDeclarationFragment fragment = ast
                    .newVariableDeclarationFragment();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

            MethodInvocation getTimestamp = ast.newMethodInvocation();
            getTimestamp.setExpression(ast.newSimpleName("checkpoint"));
            getTimestamp.setName(ast.newSimpleName("getTimestamp"));
            record.arguments().add(getTimestamp);
            testNewCheckpointBody.statements().add(
                    ast.newExpressionStatement(record));

            MethodInvocation pushStates = ast.newMethodInvocation();
            String recordType = getClassName(FieldRecord.class, state, root);
            pushStates.setExpression(createName(ast, recordType));
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Block.statements()

            MethodInvocation pushStates = ast.newMethodInvocation();
            String recordType = getClassName(FieldRecord.class, state, root);
            pushStates.setExpression(createName(ast, recordType));
            pushStates.setName(ast.newSimpleName("pushState"));
            pushStates.arguments().add(ast.newSimpleName(RECORDS_NAME));
            testNewCheckpointBody.statements().add(
                    ast.newExpressionStatement(pushStates));
            thenBranch.statements().add(testNewCheckpoint);

            // Assign the new checkpoint.
            Assignment assignment = ast.newAssignment();
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.