Java 类org.eclipse.jdt.core.dom.EmptyStatement 实例源码

项目:j2d    文件:J2dVisitor.java   
@Override
public boolean visit(EmptyStatement node) {
    //System.out.println("Found: " + node.getClass());
    indent++;
    println(";");
    indent--;
    return false;
}
项目:eclipse.jdt.ls    文件:FlowAnalyzer.java   
@Override
public boolean visit(EmptyStatement node) {
    // Empty statements aren't of any interest.
    return false;
}
项目:eclipse.jdt.ls    文件:FlowAnalyzer.java   
@Override
public void endVisit(EmptyStatement node) {
    // Leaf node.
}
项目:evosuite    文件:LoggingVisitor.java   
/** {@inheritDoc} */
@Override
public void endVisit(EmptyStatement node) {
    logger.warn("Method endVisitEmptyStatement for " + node + " for " + node + " not implemented!");
    super.endVisit(node);
}
项目:evosuite    文件:LoggingVisitor.java   
/** {@inheritDoc} */
@Override
public boolean visit(EmptyStatement node) {
    logger.warn("Method visitEmptyStatement for " + node + " for " + node + " not implemented!");
    return super.visit(node);
}
项目:Beagle    文件:NotRecursingAstVisitor.java   
@Override
public boolean visit(final EmptyStatement node) {
    return false;
}
项目:Beagle    文件:InstrumentableAstNodeLister.java   
@Override
public boolean visit(final EmptyStatement node) {
    // not instrumentable, contains nothing
    return false;
}
项目:Eclipse-Postfix-Code-Completion    文件:FlowAnalyzer.java   
@Override
public boolean visit(EmptyStatement node) {
    // Empty statements aren't of any interest.
    return false;
}
项目:Eclipse-Postfix-Code-Completion    文件:FlowAnalyzer.java   
@Override
public void endVisit(EmptyStatement node) {
    // Leaf node.
}
项目:Eclipse-Postfix-Code-Completion    文件:AstMatchingNodeFinder.java   
@Override
public boolean visit(EmptyStatement node) {
    if (node.subtreeMatch(fMatcher, fNodeToMatch))
        return matches(node);
    return super.visit(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:ConstraintCollector.java   
@Override
public boolean visit(EmptyStatement node) {
    add(fCreator.create(node));
    return true;
}
项目:Eclipse-Postfix-Code-Completion    文件:GenericVisitor.java   
@Override
public void endVisit(EmptyStatement node) {
    endVisitNode(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:GenericVisitor.java   
@Override
public boolean visit(EmptyStatement node) {
    return visitNode(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:LocalCorrectionsSubProcessor.java   
private static void addRemoveIncludingConditionProposal(IInvocationContext context, ASTNode toRemove, ASTNode replacement, Collection<ICommandAccess> proposals) {
    Image image= JavaPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
    String label= CorrectionMessages.LocalCorrectionsSubProcessor_removeunreachablecode_including_condition_description;
    AST ast= toRemove.getAST();
    ASTRewrite rewrite= ASTRewrite.create(ast);
    ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, IProposalRelevance.REMOVE_UNREACHABLE_CODE_INCLUDING_CONDITION, image);

    if (replacement == null
            || replacement instanceof EmptyStatement
            || replacement instanceof Block && ((Block)replacement).statements().size() == 0) {
        if (ASTNodes.isControlStatementBody(toRemove.getLocationInParent())) {
            rewrite.replace(toRemove, toRemove.getAST().newBlock(), null);
        } else {
            rewrite.remove(toRemove, null);
        }

    } else if (toRemove instanceof Expression && replacement instanceof Expression) {
        Expression moved= (Expression) rewrite.createMoveTarget(replacement);
        Expression toRemoveExpression= (Expression) toRemove;
        Expression replacementExpression= (Expression) replacement;
        ITypeBinding explicitCast= ASTNodes.getExplicitCast(replacementExpression, toRemoveExpression);
        if (explicitCast != null) {
            CastExpression cast= ast.newCastExpression();
            if (NecessaryParenthesesChecker.needsParentheses(replacementExpression, cast, CastExpression.EXPRESSION_PROPERTY)) {
                ParenthesizedExpression parenthesized= ast.newParenthesizedExpression();
                parenthesized.setExpression(moved);
                moved= parenthesized;
            }
            cast.setExpression(moved);
            ImportRewrite imports= proposal.createImportRewrite(context.getASTRoot());
            ImportRewriteContext importRewriteContext= new ContextSensitiveImportRewriteContext(toRemove, imports);
            cast.setType(imports.addImport(explicitCast, ast, importRewriteContext));
            moved= cast;
        }
        rewrite.replace(toRemove, moved, null);

    } else {
        ASTNode parent= toRemove.getParent();
        ASTNode moveTarget;
        if ((parent instanceof Block || parent instanceof SwitchStatement) && replacement instanceof Block) {
            ListRewrite listRewrite= rewrite.getListRewrite(replacement, Block.STATEMENTS_PROPERTY);
            List<Statement> list= ((Block)replacement).statements();
            int lastIndex= list.size() - 1;
            moveTarget= listRewrite.createMoveTarget(list.get(0), list.get(lastIndex));
        } else {
            moveTarget= rewrite.createMoveTarget(replacement);
        }

        rewrite.replace(toRemove, moveTarget, null);
    }

    proposals.add(proposal);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:FlowAnalyzer.java   
@Override
public boolean visit(EmptyStatement node) {
    // Empty statements aren't of any interest.
    return false;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:FlowAnalyzer.java   
@Override
public void endVisit(EmptyStatement node) {
    // Leaf node.
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:AstMatchingNodeFinder.java   
@Override
public boolean visit(EmptyStatement node) {
    if (node.subtreeMatch(fMatcher, fNodeToMatch))
        return matches(node);
    return super.visit(node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ConstraintCollector.java   
@Override
public boolean visit(EmptyStatement node) {
    add(fCreator.create(node));
    return true;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:HierarchicalASTVisitor.java   
@Override
public boolean visit(EmptyStatement node) {
    return visit((Statement)node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:HierarchicalASTVisitor.java   
@Override
public void endVisit(EmptyStatement node) {
    endVisit((Statement)node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ASTFlattener.java   
@Override
public boolean visit(EmptyStatement node) {
    this.fBuffer.append(";");//$NON-NLS-1$
    return false;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:GenericVisitor.java   
@Override
public boolean visit(EmptyStatement node) {
    return visitNode(node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:GenericVisitor.java   
@Override
public void endVisit(EmptyStatement node) {
    endVisitNode(node);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:LocalCorrectionsSubProcessor.java   
private static void addRemoveIncludingConditionProposal(IInvocationContext context, ASTNode toRemove, ASTNode replacement, Collection<ICommandAccess> proposals) {
    Image image= JavaPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
    String label= CorrectionMessages.LocalCorrectionsSubProcessor_removeunreachablecode_including_condition_description;
    AST ast= toRemove.getAST();
    ASTRewrite rewrite= ASTRewrite.create(ast);
    ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, 10, image);

    if (replacement == null
            || replacement instanceof EmptyStatement
            || replacement instanceof Block && ((Block)replacement).statements().size() == 0) {
        if (ASTNodes.isControlStatementBody(toRemove.getLocationInParent())) {
            rewrite.replace(toRemove, toRemove.getAST().newBlock(), null);
        } else {
            rewrite.remove(toRemove, null);
        }

    } else if (toRemove instanceof Expression && replacement instanceof Expression) {
        Expression moved= (Expression) rewrite.createMoveTarget(replacement);
        Expression toRemoveExpression= (Expression) toRemove;
        Expression replacementExpression= (Expression) replacement;
        ITypeBinding explicitCast= ASTNodes.getExplicitCast(replacementExpression, toRemoveExpression);
        if (explicitCast != null) {
            CastExpression cast= ast.newCastExpression();
            if (NecessaryParenthesesChecker.needsParentheses(replacementExpression, cast, CastExpression.EXPRESSION_PROPERTY)) {
                ParenthesizedExpression parenthesized= ast.newParenthesizedExpression();
                parenthesized.setExpression(moved);
                moved= parenthesized;
            }
            cast.setExpression(moved);
            ImportRewrite imports= proposal.createImportRewrite(context.getASTRoot());
            ImportRewriteContext importRewriteContext= new ContextSensitiveImportRewriteContext(toRemove, imports);
            cast.setType(imports.addImport(explicitCast, ast, importRewriteContext));
            moved= cast;
        }
        rewrite.replace(toRemove, moved, null);

    } else {
        ASTNode parent= toRemove.getParent();
        ASTNode moveTarget;
        if ((parent instanceof Block || parent instanceof SwitchStatement) && replacement instanceof Block) {
            ListRewrite listRewrite= rewrite.getListRewrite(replacement, Block.STATEMENTS_PROPERTY);
            List<Statement> list= ((Block)replacement).statements();
            int lastIndex= list.size() - 1;
            moveTarget= listRewrite.createMoveTarget(list.get(0), list.get(lastIndex));
        } else {
            moveTarget= rewrite.createMoveTarget(replacement);
        }

        rewrite.replace(toRemove, moveTarget, null);
    }

    proposals.add(proposal);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:NaiveASTFlattener.java   
public boolean visit(EmptyStatement node) {
    printIndent();
    this.buffer.append(";\n");//$NON-NLS-1$
    return false;
}
项目:eclipse-i18ntools    文件:ASTNodeFinder.java   
@Override
public boolean visit(final EmptyStatement node) {
    return this.internalVisit(node);
}
项目:Eclipse-Postfix-Code-Completion    文件:ConstraintCreator.java   
/**
 * @param node the AST node
 * @return array of type constraints, may be empty
 * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EmptyStatement)
 */
public ITypeConstraint[] create(EmptyStatement node) {
    return EMPTY_ARRAY;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ConstraintCreator.java   
/**
 * @param node the AST node
 * @return array of type constraints, may be empty
 * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EmptyStatement)
 */
public ITypeConstraint[] create(EmptyStatement node) {
    return EMPTY_ARRAY;
}
项目:Slicer    文件:AliasVisitor.java   
public boolean visit(EmptyStatement node){return this.visitStatement(node);}