Search in sources :

Example 1 with IfStatement

use of org.eclipse.jdt.core.dom.IfStatement in project che by eclipse.

the class ExtractToNullCheckedLocalProposal method getRewrite.

@Override
protected ASTRewrite getRewrite() throws CoreException {
    // infrastructure:
    AST ast = this.compilationUnit.getAST();
    ASTRewrite rewrite = ASTRewrite.create(ast);
    ImportRewrite imports = ImportRewrite.create(this.compilationUnit, true);
    TextEditGroup group = new TextEditGroup(FixMessages.ExtractToNullCheckedLocalProposal_extractCheckedLocal_editName);
    LinkedProposalPositionGroup localNameGroup = new LinkedProposalPositionGroup(LOCAL_NAME_POSITION_GROUP);
    getLinkedProposalModel().addPositionGroup(localNameGroup);
    // AST context:
    Statement origStmt = (Statement) ASTNodes.getParent(this.fieldReference, Statement.class);
    // determine suitable strategy for rearranging elements towards a new code structure:
    RearrangeStrategy rearrangeStrategy = RearrangeStrategy.create(origStmt, rewrite, group);
    Expression toReplace;
    ASTNode directParent = this.fieldReference.getParent();
    if (directParent instanceof FieldAccess) {
        toReplace = (Expression) directParent;
    } else if (directParent instanceof QualifiedName && this.fieldReference.getLocationInParent() == QualifiedName.NAME_PROPERTY) {
        toReplace = (Expression) directParent;
    } else {
        toReplace = this.fieldReference;
    }
    // new local declaration initialized from the field reference
    VariableDeclarationFragment localFrag = ast.newVariableDeclarationFragment();
    VariableDeclarationStatement localDecl = ast.newVariableDeclarationStatement(localFrag);
    // ... type
    localDecl.setType(newType(toReplace.resolveTypeBinding(), ast, imports));
    localDecl.modifiers().add(ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
    // ... name
    String localName = proposeLocalName(this.fieldReference, this.compilationUnit, getCompilationUnit().getJavaProject());
    localFrag.setName(ast.newSimpleName(localName));
    // ... initialization
    localFrag.setInitializer((Expression) ASTNode.copySubtree(ast, toReplace));
    rearrangeStrategy.insertLocalDecl(localDecl);
    // if statement:
    IfStatement ifStmt = ast.newIfStatement();
    // condition:
    InfixExpression nullCheck = ast.newInfixExpression();
    nullCheck.setLeftOperand(ast.newSimpleName(localName));
    nullCheck.setRightOperand(ast.newNullLiteral());
    nullCheck.setOperator(InfixExpression.Operator.NOT_EQUALS);
    ifStmt.setExpression(nullCheck);
    // then block: the original statement
    Block thenBlock = ast.newBlock();
    thenBlock.statements().add(rearrangeStrategy.createMoveTargetForOrigStmt());
    ifStmt.setThenStatement(thenBlock);
    // ... but with the field reference replaced by the new local:
    SimpleName dereferencedName = ast.newSimpleName(localName);
    rewrite.replace(toReplace, dereferencedName, group);
    // else block: a Todo comment
    Block elseBlock = ast.newBlock();
    //$NON-NLS-1$
    String elseStatement = "// TODO " + FixMessages.ExtractToNullCheckedLocalProposal_todoHandleNullDescription;
    if (origStmt instanceof ReturnStatement) {
        Type returnType = newType(((ReturnStatement) origStmt).getExpression().resolveTypeBinding(), ast, imports);
        ReturnStatement returnStatement = ast.newReturnStatement();
        returnStatement.setExpression(ASTNodeFactory.newDefaultExpression(ast, returnType, 0));
        elseStatement += '\n' + ASTNodes.asFormattedString(returnStatement, 0, String.valueOf('\n'), getCompilationUnit().getJavaProject().getOptions(true));
    }
    EmptyStatement todoNode = (EmptyStatement) rewrite.createStringPlaceholder(elseStatement, ASTNode.EMPTY_STATEMENT);
    elseBlock.statements().add(todoNode);
    ifStmt.setElseStatement(elseBlock);
    // link all three occurrences of the new local variable:
    addLinkedPosition(rewrite.track(localFrag.getName()), true, /*first*/
    LOCAL_NAME_POSITION_GROUP);
    addLinkedPosition(rewrite.track(nullCheck.getLeftOperand()), false, LOCAL_NAME_POSITION_GROUP);
    addLinkedPosition(rewrite.track(dereferencedName), false, LOCAL_NAME_POSITION_GROUP);
    rearrangeStrategy.insertIfStatement(ifStmt, thenBlock);
    return rewrite;
}
Also used : AST(org.eclipse.jdt.core.dom.AST) ImportRewrite(org.eclipse.jdt.core.dom.rewrite.ImportRewrite) Statement(org.eclipse.jdt.core.dom.Statement) IfStatement(org.eclipse.jdt.core.dom.IfStatement) ReturnStatement(org.eclipse.jdt.core.dom.ReturnStatement) EmptyStatement(org.eclipse.jdt.core.dom.EmptyStatement) VariableDeclarationStatement(org.eclipse.jdt.core.dom.VariableDeclarationStatement) QualifiedName(org.eclipse.jdt.core.dom.QualifiedName) SimpleName(org.eclipse.jdt.core.dom.SimpleName) EmptyStatement(org.eclipse.jdt.core.dom.EmptyStatement) IfStatement(org.eclipse.jdt.core.dom.IfStatement) Type(org.eclipse.jdt.core.dom.Type) PrimitiveType(org.eclipse.jdt.core.dom.PrimitiveType) ParameterizedType(org.eclipse.jdt.core.dom.ParameterizedType) Expression(org.eclipse.jdt.core.dom.Expression) InfixExpression(org.eclipse.jdt.core.dom.InfixExpression) VariableDeclarationFragment(org.eclipse.jdt.core.dom.VariableDeclarationFragment) ASTNode(org.eclipse.jdt.core.dom.ASTNode) InfixExpression(org.eclipse.jdt.core.dom.InfixExpression) ReturnStatement(org.eclipse.jdt.core.dom.ReturnStatement) ASTRewrite(org.eclipse.jdt.core.dom.rewrite.ASTRewrite) VariableDeclarationStatement(org.eclipse.jdt.core.dom.VariableDeclarationStatement) Block(org.eclipse.jdt.core.dom.Block) FieldAccess(org.eclipse.jdt.core.dom.FieldAccess) TextEditGroup(org.eclipse.text.edits.TextEditGroup) LinkedProposalPositionGroup(org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup)

Example 2 with IfStatement

use of org.eclipse.jdt.core.dom.IfStatement in project che by eclipse.

the class SourceProvider method isDangligIf.

public boolean isDangligIf() {
    List<Statement> statements = fDeclaration.getBody().statements();
    if (statements.size() != 1)
        return false;
    ASTNode p = statements.get(0);
    while (true) {
        if (p instanceof IfStatement) {
            return ((IfStatement) p).getElseStatement() == null;
        } else {
            ChildPropertyDescriptor childD;
            if (p instanceof WhileStatement) {
                childD = WhileStatement.BODY_PROPERTY;
            } else if (p instanceof ForStatement) {
                childD = ForStatement.BODY_PROPERTY;
            } else if (p instanceof EnhancedForStatement) {
                childD = EnhancedForStatement.BODY_PROPERTY;
            } else if (p instanceof DoStatement) {
                childD = DoStatement.BODY_PROPERTY;
            } else if (p instanceof LabeledStatement) {
                childD = LabeledStatement.BODY_PROPERTY;
            } else {
                return false;
            }
            Statement body = (Statement) p.getStructuralProperty(childD);
            if (body instanceof Block) {
                return false;
            } else {
                p = body;
            }
        }
    }
}
Also used : IfStatement(org.eclipse.jdt.core.dom.IfStatement) ChildPropertyDescriptor(org.eclipse.jdt.core.dom.ChildPropertyDescriptor) LabeledStatement(org.eclipse.jdt.core.dom.LabeledStatement) DoStatement(org.eclipse.jdt.core.dom.DoStatement) DoStatement(org.eclipse.jdt.core.dom.DoStatement) Statement(org.eclipse.jdt.core.dom.Statement) EnhancedForStatement(org.eclipse.jdt.core.dom.EnhancedForStatement) IfStatement(org.eclipse.jdt.core.dom.IfStatement) WhileStatement(org.eclipse.jdt.core.dom.WhileStatement) ReturnStatement(org.eclipse.jdt.core.dom.ReturnStatement) LabeledStatement(org.eclipse.jdt.core.dom.LabeledStatement) ForStatement(org.eclipse.jdt.core.dom.ForStatement) ASTNode(org.eclipse.jdt.core.dom.ASTNode) Block(org.eclipse.jdt.core.dom.Block) EnhancedForStatement(org.eclipse.jdt.core.dom.EnhancedForStatement) WhileStatement(org.eclipse.jdt.core.dom.WhileStatement) EnhancedForStatement(org.eclipse.jdt.core.dom.EnhancedForStatement) ForStatement(org.eclipse.jdt.core.dom.ForStatement)

Example 3 with IfStatement

use of org.eclipse.jdt.core.dom.IfStatement in project che by eclipse.

the class CallInliner method initializeInsertionPoint.

private void initializeInsertionPoint(int nos) {
    fInsertionIndex = -1;
    fNeedsStatement = false;
    // if we have a constructor invocation the invocation itself is already a statement
    ASTNode parentStatement = fInvocation instanceof Statement ? fInvocation : ASTNodes.getParent(fInvocation, Statement.class);
    if (parentStatement == null)
        return;
    ASTNode container = parentStatement.getParent();
    int type = container.getNodeType();
    if (type == ASTNode.BLOCK) {
        Block block = (Block) container;
        fListRewrite = fRewrite.getListRewrite(block, Block.STATEMENTS_PROPERTY);
        fInsertionIndex = fListRewrite.getRewrittenList().indexOf(parentStatement);
    } else if (type == ASTNode.SWITCH_STATEMENT) {
        SwitchStatement switchStatement = (SwitchStatement) container;
        fListRewrite = fRewrite.getListRewrite(switchStatement, SwitchStatement.STATEMENTS_PROPERTY);
        fInsertionIndex = fListRewrite.getRewrittenList().indexOf(parentStatement);
    } else if (isControlStatement(container) || type == ASTNode.LABELED_STATEMENT) {
        fNeedsStatement = true;
        if (nos > 1 || needsBlockAroundDanglingIf()) {
            Block block = fInvocation.getAST().newBlock();
            fInsertionIndex = 0;
            Statement currentStatement = null;
            switch(type) {
                case ASTNode.LABELED_STATEMENT:
                    currentStatement = ((LabeledStatement) container).getBody();
                    break;
                case ASTNode.FOR_STATEMENT:
                    currentStatement = ((ForStatement) container).getBody();
                    break;
                case ASTNode.ENHANCED_FOR_STATEMENT:
                    currentStatement = ((EnhancedForStatement) container).getBody();
                    break;
                case ASTNode.WHILE_STATEMENT:
                    currentStatement = ((WhileStatement) container).getBody();
                    break;
                case ASTNode.DO_STATEMENT:
                    currentStatement = ((DoStatement) container).getBody();
                    break;
                case ASTNode.IF_STATEMENT:
                    IfStatement node = (IfStatement) container;
                    Statement thenPart = node.getThenStatement();
                    if (fTargetNode == thenPart || ASTNodes.isParent(fTargetNode, thenPart)) {
                        currentStatement = thenPart;
                    } else {
                        currentStatement = node.getElseStatement();
                    }
                    break;
            }
            Assert.isNotNull(currentStatement);
            fRewrite.replace(currentStatement, block, null);
            fListRewrite = fRewrite.getListRewrite(block, Block.STATEMENTS_PROPERTY);
            // The method to be inlined is not the body of the control statement.
            if (currentStatement != fTargetNode) {
                fListRewrite.insertLast(fRewrite.createCopyTarget(currentStatement), null);
            } else {
                // We can't replace a copy with something else. So we
                // have to insert all statements to be inlined.
                fTargetNode = null;
            }
        }
    }
// We only insert one new statement or we delete the existing call.
// So there is no need to have an insertion index.
}
Also used : IfStatement(org.eclipse.jdt.core.dom.IfStatement) SwitchStatement(org.eclipse.jdt.core.dom.SwitchStatement) DoStatement(org.eclipse.jdt.core.dom.DoStatement) Statement(org.eclipse.jdt.core.dom.Statement) EnhancedForStatement(org.eclipse.jdt.core.dom.EnhancedForStatement) SwitchStatement(org.eclipse.jdt.core.dom.SwitchStatement) IfStatement(org.eclipse.jdt.core.dom.IfStatement) WhileStatement(org.eclipse.jdt.core.dom.WhileStatement) ReturnStatement(org.eclipse.jdt.core.dom.ReturnStatement) LabeledStatement(org.eclipse.jdt.core.dom.LabeledStatement) ForStatement(org.eclipse.jdt.core.dom.ForStatement) VariableDeclarationStatement(org.eclipse.jdt.core.dom.VariableDeclarationStatement) ASTNode(org.eclipse.jdt.core.dom.ASTNode) Block(org.eclipse.jdt.core.dom.Block)

Example 4 with IfStatement

use of org.eclipse.jdt.core.dom.IfStatement in project flux by eclipse.

the class QuickAssistProcessor method getAddBlockProposals.

private static boolean getAddBlockProposals(IInvocationContext context, ASTNode node, Collection<ICommandAccess> resultingCollections) {
    if (!(node instanceof Statement)) {
        return false;
    }
    /*
		 * only show the quick assist when the selection is of the control statement keywords (if, else, while,...)
		 * but not inside the statement or the if expression.
		 */
    if (!isControlStatementWithBlock(node) && isControlStatementWithBlock(node.getParent())) {
        int statementStart = node.getStartPosition();
        int statementEnd = statementStart + node.getLength();
        int offset = context.getSelectionOffset();
        int length = context.getSelectionLength();
        if (length == 0) {
            if (offset != statementEnd) {
                // cursor at end
                return false;
            }
        } else {
            if (offset > statementStart || offset + length < statementEnd) {
                // statement selected
                return false;
            }
        }
        node = node.getParent();
    }
    StructuralPropertyDescriptor childProperty = null;
    ASTNode child = null;
    switch(node.getNodeType()) {
        case ASTNode.IF_STATEMENT:
            ASTNode then = ((IfStatement) node).getThenStatement();
            ASTNode elseStatement = ((IfStatement) node).getElseStatement();
            if ((then instanceof Block) && (elseStatement instanceof Block || elseStatement == null)) {
                break;
            }
            int thenEnd = then.getStartPosition() + then.getLength();
            int selectionEnd = context.getSelectionOffset() + context.getSelectionLength();
            if (!(then instanceof Block)) {
                if (selectionEnd <= thenEnd) {
                    childProperty = IfStatement.THEN_STATEMENT_PROPERTY;
                    child = then;
                    break;
                } else if (elseStatement != null && selectionEnd < elseStatement.getStartPosition()) {
                    // find out if we are before or after the 'else' keyword
                    try {
                        TokenScanner scanner = new TokenScanner(context.getCompilationUnit());
                        int elseTokenStart = scanner.getNextStartOffset(thenEnd, true);
                        if (selectionEnd < elseTokenStart) {
                            childProperty = IfStatement.THEN_STATEMENT_PROPERTY;
                            child = then;
                            break;
                        }
                    } catch (CoreException e) {
                    // ignore
                    }
                }
            }
            if (elseStatement != null && !(elseStatement instanceof Block) && context.getSelectionOffset() >= thenEnd) {
                childProperty = IfStatement.ELSE_STATEMENT_PROPERTY;
                child = elseStatement;
            }
            break;
        case ASTNode.WHILE_STATEMENT:
            ASTNode whileBody = ((WhileStatement) node).getBody();
            if (!(whileBody instanceof Block)) {
                childProperty = WhileStatement.BODY_PROPERTY;
                child = whileBody;
            }
            break;
        case ASTNode.FOR_STATEMENT:
            ASTNode forBody = ((ForStatement) node).getBody();
            if (!(forBody instanceof Block)) {
                childProperty = ForStatement.BODY_PROPERTY;
                child = forBody;
            }
            break;
        case ASTNode.ENHANCED_FOR_STATEMENT:
            ASTNode enhancedForBody = ((EnhancedForStatement) node).getBody();
            if (!(enhancedForBody instanceof Block)) {
                childProperty = EnhancedForStatement.BODY_PROPERTY;
                child = enhancedForBody;
            }
            break;
        case ASTNode.DO_STATEMENT:
            ASTNode doBody = ((DoStatement) node).getBody();
            if (!(doBody instanceof Block)) {
                childProperty = DoStatement.BODY_PROPERTY;
                child = doBody;
            }
            break;
        default:
    }
    if (child == null) {
        return false;
    }
    if (resultingCollections == null) {
        return true;
    }
    AST ast = node.getAST();
    {
        ASTRewrite rewrite = ASTRewrite.create(ast);
        ASTNode childPlaceholder = rewrite.createMoveTarget(child);
        Block replacingBody = ast.newBlock();
        replacingBody.statements().add(childPlaceholder);
        rewrite.set(node, childProperty, replacingBody, null);
        String label;
        if (childProperty == IfStatement.THEN_STATEMENT_PROPERTY) {
            label = CorrectionMessages.QuickAssistProcessor_replacethenwithblock_description;
        } else if (childProperty == IfStatement.ELSE_STATEMENT_PROPERTY) {
            label = CorrectionMessages.QuickAssistProcessor_replaceelsewithblock_description;
        } else {
            label = CorrectionMessages.QuickAssistProcessor_replacebodywithblock_description;
        }
        //			Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
        LinkedCorrectionProposal proposal = new LinkedCorrectionProposal(label, context.getCompilationUnit(), rewrite, IProposalRelevance.ADD_BLOCK);
        proposal.setCommandId(ADD_BLOCK_ID);
        proposal.setEndPosition(rewrite.track(child));
        resultingCollections.add(proposal);
    }
    if (node.getNodeType() == ASTNode.IF_STATEMENT) {
        ASTRewrite rewrite = ASTRewrite.create(ast);
        while (node.getLocationInParent() == IfStatement.ELSE_STATEMENT_PROPERTY) {
            node = node.getParent();
        }
        boolean missingBlockFound = false;
        boolean foundElse = false;
        IfStatement ifStatement;
        Statement thenStatment;
        Statement elseStatment;
        do {
            ifStatement = (IfStatement) node;
            thenStatment = ifStatement.getThenStatement();
            elseStatment = ifStatement.getElseStatement();
            if (!(thenStatment instanceof Block)) {
                ASTNode childPlaceholder1 = rewrite.createMoveTarget(thenStatment);
                Block replacingBody1 = ast.newBlock();
                replacingBody1.statements().add(childPlaceholder1);
                rewrite.set(ifStatement, IfStatement.THEN_STATEMENT_PROPERTY, replacingBody1, null);
                if (thenStatment != child) {
                    missingBlockFound = true;
                }
            }
            if (elseStatment != null) {
                foundElse = true;
            }
            node = elseStatment;
        } while (elseStatment instanceof IfStatement);
        if (elseStatment != null && !(elseStatment instanceof Block)) {
            ASTNode childPlaceholder2 = rewrite.createMoveTarget(elseStatment);
            Block replacingBody2 = ast.newBlock();
            replacingBody2.statements().add(childPlaceholder2);
            rewrite.set(ifStatement, IfStatement.ELSE_STATEMENT_PROPERTY, replacingBody2, null);
            if (elseStatment != child) {
                missingBlockFound = true;
            }
        }
        if (missingBlockFound && foundElse) {
            String label = CorrectionMessages.QuickAssistProcessor_replacethenelsewithblock_description;
            //				Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
            ASTRewriteCorrectionProposal proposal = new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, IProposalRelevance.CHANGE_IF_ELSE_TO_BLOCK);
            resultingCollections.add(proposal);
        }
    }
    return true;
}
Also used : AST(org.eclipse.jdt.core.dom.AST) TokenScanner(org.eclipse.jdt.internal.corext.dom.TokenScanner) DoStatement(org.eclipse.jdt.core.dom.DoStatement) DoStatement(org.eclipse.jdt.core.dom.DoStatement) Statement(org.eclipse.jdt.core.dom.Statement) EnhancedForStatement(org.eclipse.jdt.core.dom.EnhancedForStatement) ExpressionStatement(org.eclipse.jdt.core.dom.ExpressionStatement) TryStatement(org.eclipse.jdt.core.dom.TryStatement) IfStatement(org.eclipse.jdt.core.dom.IfStatement) WhileStatement(org.eclipse.jdt.core.dom.WhileStatement) ReturnStatement(org.eclipse.jdt.core.dom.ReturnStatement) ForStatement(org.eclipse.jdt.core.dom.ForStatement) VariableDeclarationStatement(org.eclipse.jdt.core.dom.VariableDeclarationStatement) WhileStatement(org.eclipse.jdt.core.dom.WhileStatement) ASTRewriteCorrectionProposal(org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposal) IfStatement(org.eclipse.jdt.core.dom.IfStatement) CoreException(org.eclipse.core.runtime.CoreException) LinkedCorrectionProposal(org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedCorrectionProposal) ASTNode(org.eclipse.jdt.core.dom.ASTNode) Block(org.eclipse.jdt.core.dom.Block) ASTRewrite(org.eclipse.jdt.core.dom.rewrite.ASTRewrite) EnhancedForStatement(org.eclipse.jdt.core.dom.EnhancedForStatement) EnhancedForStatement(org.eclipse.jdt.core.dom.EnhancedForStatement) ForStatement(org.eclipse.jdt.core.dom.ForStatement) StructuralPropertyDescriptor(org.eclipse.jdt.core.dom.StructuralPropertyDescriptor)

Example 5 with IfStatement

use of org.eclipse.jdt.core.dom.IfStatement in project flux by eclipse.

the class AdvancedQuickAssistProcessor method getInverseIfProposals.

private static boolean getInverseIfProposals(IInvocationContext context, ASTNode covering, Collection<ICommandAccess> resultingCollections) {
    if (!(covering instanceof IfStatement)) {
        return false;
    }
    IfStatement ifStatement = (IfStatement) covering;
    if (ifStatement.getElseStatement() == null) {
        return false;
    }
    //  we could produce quick assist
    if (resultingCollections == null) {
        return true;
    }
    //
    AST ast = covering.getAST();
    ASTRewrite rewrite = ASTRewrite.create(ast);
    Statement thenStatement = ifStatement.getThenStatement();
    Statement elseStatement = ifStatement.getElseStatement();
    // prepare original nodes
    Expression inversedExpression = getInversedExpression(rewrite, ifStatement.getExpression());
    Statement newElseStatement = (Statement) rewrite.createMoveTarget(thenStatement);
    Statement newThenStatement = (Statement) rewrite.createMoveTarget(elseStatement);
    // set new nodes
    rewrite.set(ifStatement, IfStatement.EXPRESSION_PROPERTY, inversedExpression, null);
    if (elseStatement instanceof IfStatement) {
        // bug 79507 && bug 74580
        Block elseBlock = ast.newBlock();
        elseBlock.statements().add(newThenStatement);
        newThenStatement = elseBlock;
    }
    rewrite.set(ifStatement, IfStatement.THEN_STATEMENT_PROPERTY, newThenStatement, null);
    rewrite.set(ifStatement, IfStatement.ELSE_STATEMENT_PROPERTY, newElseStatement, null);
    // add correction proposal
    String label = CorrectionMessages.AdvancedQuickAssistProcessor_inverseIf_description;
    //		Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
    ASTRewriteCorrectionProposal proposal = new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, IProposalRelevance.INVERSE_IF_STATEMENT);
    resultingCollections.add(proposal);
    return true;
}
Also used : ASTRewriteCorrectionProposal(org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposal) IfStatement(org.eclipse.jdt.core.dom.IfStatement) AST(org.eclipse.jdt.core.dom.AST) ConditionalExpression(org.eclipse.jdt.core.dom.ConditionalExpression) InstanceofExpression(org.eclipse.jdt.core.dom.InstanceofExpression) Expression(org.eclipse.jdt.core.dom.Expression) InfixExpression(org.eclipse.jdt.core.dom.InfixExpression) CastExpression(org.eclipse.jdt.core.dom.CastExpression) ParenthesizedExpression(org.eclipse.jdt.core.dom.ParenthesizedExpression) LambdaExpression(org.eclipse.jdt.core.dom.LambdaExpression) PrefixExpression(org.eclipse.jdt.core.dom.PrefixExpression) DoStatement(org.eclipse.jdt.core.dom.DoStatement) Statement(org.eclipse.jdt.core.dom.Statement) ContinueStatement(org.eclipse.jdt.core.dom.ContinueStatement) EnhancedForStatement(org.eclipse.jdt.core.dom.EnhancedForStatement) ExpressionStatement(org.eclipse.jdt.core.dom.ExpressionStatement) AssertStatement(org.eclipse.jdt.core.dom.AssertStatement) SwitchStatement(org.eclipse.jdt.core.dom.SwitchStatement) IfStatement(org.eclipse.jdt.core.dom.IfStatement) WhileStatement(org.eclipse.jdt.core.dom.WhileStatement) ReturnStatement(org.eclipse.jdt.core.dom.ReturnStatement) BreakStatement(org.eclipse.jdt.core.dom.BreakStatement) ForStatement(org.eclipse.jdt.core.dom.ForStatement) VariableDeclarationStatement(org.eclipse.jdt.core.dom.VariableDeclarationStatement) ASTRewrite(org.eclipse.jdt.core.dom.rewrite.ASTRewrite) Block(org.eclipse.jdt.core.dom.Block)

Aggregations

IfStatement (org.eclipse.jdt.core.dom.IfStatement)30 Statement (org.eclipse.jdt.core.dom.Statement)28 Block (org.eclipse.jdt.core.dom.Block)19 EnhancedForStatement (org.eclipse.jdt.core.dom.EnhancedForStatement)19 ForStatement (org.eclipse.jdt.core.dom.ForStatement)19 ReturnStatement (org.eclipse.jdt.core.dom.ReturnStatement)19 WhileStatement (org.eclipse.jdt.core.dom.WhileStatement)19 DoStatement (org.eclipse.jdt.core.dom.DoStatement)18 VariableDeclarationStatement (org.eclipse.jdt.core.dom.VariableDeclarationStatement)16 AST (org.eclipse.jdt.core.dom.AST)15 ASTRewrite (org.eclipse.jdt.core.dom.rewrite.ASTRewrite)15 Expression (org.eclipse.jdt.core.dom.Expression)14 ExpressionStatement (org.eclipse.jdt.core.dom.ExpressionStatement)14 InfixExpression (org.eclipse.jdt.core.dom.InfixExpression)14 SwitchStatement (org.eclipse.jdt.core.dom.SwitchStatement)14 ASTNode (org.eclipse.jdt.core.dom.ASTNode)13 ASTRewriteCorrectionProposal (org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposal)13 AssertStatement (org.eclipse.jdt.core.dom.AssertStatement)12 BreakStatement (org.eclipse.jdt.core.dom.BreakStatement)12 ContinueStatement (org.eclipse.jdt.core.dom.ContinueStatement)12