private void createLoopReentranceVisitor(ASTNode node) { if (fLoopReentranceVisitor == null && fDoLoopReentrance && fSelection.coveredBy(node)) { fLoopReentranceVisitor = new LoopReentranceVisitor(fFlowContext, fSelection, node); } }
private void createLoopReentranceVisitor(ASTNode node) { if (fLoopReentranceVisitor == null && fDoLoopReentrance && fSelection.coveredBy(node)) fLoopReentranceVisitor= new LoopReentranceVisitor(fFlowContext, fSelection, node); }
private void createLoopReentranceVisitor(ASTNode node) { if (fLoopReentranceVisitor == null && fDoLoopReentrance && fSelection.coveredBy(node)) fLoopReentranceVisitor= new LoopReentranceVisitor(fFlowContext, fSelection, node); }
@Override protected boolean visitNode(ASTNode node) { if (node.getStartPosition() > fSelection.getInclusiveEnd()) return true; if (fSelection.coveredBy(node)) return true; return false; } @Override
protected boolean visitNode(ASTNode node) { if (node.getStartPosition() > fSelection.getInclusiveEnd()) return true; if (fSelection.coveredBy(node)) return true; return false; } public boolean visit(SimpleName node) {
@Override protected boolean visitNode(ASTNode node) { if (node.getStartPosition() > fSelection.getInclusiveEnd()) return true; if (fSelection.coveredBy(node)) return true; return false; } @Override
private boolean visitSimpleName(SimpleName name) { if (getSelection().coveredBy(name)) return addNodeAndStop(name); return super.visitNode(name); }
private boolean visitSimpleName(SimpleName name) { if (getSelection().coveredBy(name)) return addNodeAndStop(name); return super.visitNode(name); }
private boolean visitSimpleName(SimpleName name) { if (getSelection().coveredBy(name)) return addNodeAndStop(name); return super.visitNode(name); }
private void endVisitConditional(GenericSequentialFlowInfo info, ASTNode condition, ASTNode[] branches) { info.merge(getFlowInfo(condition), fFlowContext); for (int i = 0; i < branches.length; i++) { ASTNode branch = branches[i]; if (branch != null && fSelection.coveredBy(branch)) { info.merge(getFlowInfo(branch), fFlowContext); break; } } }
private void endVisitConditional(GenericSequentialFlowInfo info, ASTNode condition, ASTNode[] branches) { info.merge(getFlowInfo(condition), fFlowContext); for (int i= 0; i < branches.length; i++) { ASTNode branch= branches[i]; if (branch != null && fSelection.coveredBy(branch)) { info.merge(getFlowInfo(branch), fFlowContext); break; } } }
private void endVisitConditional(GenericSequentialFlowInfo info, ASTNode condition, ASTNode[] branches) { info.merge(getFlowInfo(condition), fFlowContext); for (int i= 0; i < branches.length; i++) { ASTNode branch= branches[i]; if (branch != null && fSelection.coveredBy(branch)) { info.merge(getFlowInfo(branch), fFlowContext); break; } } }
private void endVisitConditional(GenericSequentialFlowInfo info, ASTNode condition, ASTNode[] branches) { info.merge(getFlowInfo(condition), fFlowContext); for (int i= 0; i < branches.length; i++) { ASTNode branch= branches[i]; if (branch != null && fSelection.coveredBy(branch)) { info.merge(getFlowInfo(branch), fFlowContext); break; } } }
@Override public void endVisit(IfStatement node) { if (skipNode(node)) { return; } Statement thenPart = node.getThenStatement(); Statement elsePart = node.getElseStatement(); if ((thenPart != null && fSelection.coveredBy(thenPart)) || (elsePart != null && fSelection.coveredBy(elsePart))) { GenericSequentialFlowInfo info = createSequential(); setFlowInfo(node, info); endVisitConditional(info, node.getExpression(), new ASTNode[] { thenPart, elsePart }); } else { super.endVisit(node); } }
public void endVisit(ConditionalExpression node) { if (skipNode(node)) return; Expression thenPart= node.getThenExpression(); Expression elsePart= node.getElseExpression(); if ((thenPart != null && fSelection.coveredBy(thenPart)) || (elsePart != null && fSelection.coveredBy(elsePart))) { GenericSequentialFlowInfo info= createSequential(); setFlowInfo(node, info); endVisitConditional(info, node.getExpression(), new ASTNode[] {thenPart, elsePart}); } else { super.endVisit(node); } }
@Override public void endVisit(ConditionalExpression node) { if (skipNode(node)) { return; } Expression thenPart = node.getThenExpression(); Expression elsePart = node.getElseExpression(); if ((thenPart != null && fSelection.coveredBy(thenPart)) || (elsePart != null && fSelection.coveredBy(elsePart))) { GenericSequentialFlowInfo info = createSequential(); setFlowInfo(node, info); endVisitConditional(info, node.getExpression(), new ASTNode[] { thenPart, elsePart }); } else { super.endVisit(node); } }
public void endVisit(IfStatement node) { if (skipNode(node)) return; Statement thenPart= node.getThenStatement(); Statement elsePart= node.getElseStatement(); if ((thenPart != null && fSelection.coveredBy(thenPart)) || (elsePart != null && fSelection.coveredBy(elsePart))) { GenericSequentialFlowInfo info= createSequential(); setFlowInfo(node, info); endVisitConditional(info, node.getExpression(), new ASTNode[] {thenPart, elsePart}); } else { super.endVisit(node); } }
@Override public void endVisit(IfStatement node) { if (skipNode(node)) return; Statement thenPart= node.getThenStatement(); Statement elsePart= node.getElseStatement(); if ((thenPart != null && fSelection.coveredBy(thenPart)) || (elsePart != null && fSelection.coveredBy(elsePart))) { GenericSequentialFlowInfo info= createSequential(); setFlowInfo(node, info); endVisitConditional(info, node.getExpression(), new ASTNode[] {thenPart, elsePart}); } else { super.endVisit(node); } }
private void handleLoopReentrance(ASTNode node) { if (!fSelection.coveredBy(node) || fLoopReentranceVisitor == null || fLoopReentranceVisitor.getLoopNode() != node) return; fLoopReentranceVisitor.process(node); GenericSequentialFlowInfo info= createSequential(); info.merge(getFlowInfo(node), fFlowContext); info.merge(fLoopReentranceVisitor.getFlowInfo(node), fFlowContext); setFlowInfo(node, info); } }
@Override public boolean visit(Assignment node) { boolean result= super.visit(node); if ((getSelection().covers(node.getLeftHandSide()) && !getSelection().covers(node.getRightHandSide())) || getSelection().coveredBy(node.getLeftHandSide())) { invalidSelection( RefactoringCoreMessages.ExtractMethodAnalyzer_leftHandSideOfAssignment, JavaStatusContext.create(fCUnit, node)); return false; } return result; }