Java 类com.sun.source.tree.ContinueTree 实例源码

项目:checker-framework    文件:CFGBuilder.java   
@Override
public Node visitContinue(ContinueTree tree, Void p) {
    Name label = tree.getLabel();
    if (label == null) {
        assert continueTargetL != null : "no target for continue statement";

        extendWithExtendedNode(new UnconditionalJump(continueTargetL));
    } else {
        assert continueLabels.containsKey(label);

        extendWithExtendedNode(new UnconditionalJump(
                continueLabels.get(label)));
    }

    return null;
}
项目:incubator-netbeans    文件:TreeDuplicator.java   
@Override
    public Tree visitContinue(ContinueTree tree, Void p) {
        ContinueTree n = make.Continue(tree.getLabel());
//        model.setType(n, model.getType(tree));
        comments.copyComments(tree, n);
        model.setPos(n, model.getPos(tree));
        return n;
    }
项目:incubator-netbeans    文件:CopyFinder.java   
public Boolean visitContinue(ContinueTree node, TreePath p) {
    if (p == null) {
        super.visitContinue(node, p);
        return false;
    }

    //XXX: check labels
    return true;
}
项目:incubator-netbeans    文件:LabelsTest.java   
public Void visitContinue(ContinueTree node, Object p) {
    System.err.println("visitContinue: " + node.getLabel());
    super.visitContinue(node, p);
    ContinueTree copy = make.setLabel(node, node.getLabel() + "0");
    this.copy.rewrite(node, copy);
    return null;
}
项目:incubator-netbeans    文件:BreakContinueTest.java   
public void testContinue158130() throws Exception {
    String test = "public class Test { void m(int p) { loop: while (true) { if (p == 0) { con|tinue loop; } } } }";
    String golden = "public class Test { void m(int p) { loop: while (true) { if (p == 0) { continue; } } } }";
    testHelper(test, golden, Kind.CONTINUE, new Delegate() {

        public void run(WorkingCopy copy, Tree tree) {
            ContinueTree original = (ContinueTree) tree;
            TreeMaker make = copy.getTreeMaker();
            ContinueTree modified = make.Continue(null);
            copy.rewrite(original, modified);
        }
    });
}
项目:incubator-netbeans    文件:TreeNode.java   
@Override
public Void visitContinue(ContinueTree tree, List<Node> d) {
    List<Node> below = new ArrayList<Node>();

    addCorrespondingType(below);
    addCorrespondingComments(below);
    super.visitContinue(tree, below);

    d.add(new TreeNode(info, getCurrentPath(), below));
    return null;
}
项目:incubator-netbeans    文件:PreconditionsChecker.java   
@Override
public Tree visitContinue(ContinueTree that, Trees trees) {
    if (that.getLabel() != null || !isIfWithContinueOnly(that)) {
        this.hasContinue = true;
    }
    return super.visitContinue(that, trees);
}
项目:incubator-netbeans    文件:PreconditionsChecker.java   
private boolean isIfWithContinueOnly(ContinueTree that) {
    TreePath currentTreePath = this.getCurrentPath();
    TreePath parentPath = currentTreePath.getParentPath();
    Tree parentTree = parentPath.getLeaf();
    if (parentTree.getKind() == Tree.Kind.IF) {
        return true;
    } else if (parentTree.getKind() == Tree.Kind.BLOCK) {
        BlockTree parentBlock = (BlockTree) parentTree;
        if (parentBlock.getStatements().size() == 1) {
            return true;
        }
    }
    return false;
}
项目:incubator-netbeans    文件:TryCatchFinally.java   
@Override
public Void visitContinue(ContinueTree node, Collection<TreePath> trees) {
    if (!analyzeThrows && !seenTrees.contains(info.getTreeUtilities().getBreakContinueTarget(getCurrentPath()))) {
        trees.add(getCurrentPath());
    }
    return null;
}
项目:incubator-netbeans    文件:ScanStatement.java   
@Override
public Void visitContinue(ContinueTree node, Void p) {
    if (isMethodCode() && phase == PHASE_INSIDE_SELECTION && !treesSeensInSelection.contains(info.getTreeUtilities().getBreakContinueTarget(getCurrentPath()))) {
        selectionExits.add(getCurrentPath());
        hasContinues = true;
    }
    return super.visitContinue(node, p);
}
项目:incubator-netbeans    文件:EvaluatorVisitor.java   
@Override
public Mirror visitContinue(ContinueTree arg0, EvaluationContext evaluationContext) {
    Name label = arg0.getLabel();
    if (label != null) {
        Assert.error(arg0, "unsupported");
        return null;
    }
    return new Continue();
}
项目:javaide    文件:JavaInputAstVisitor.java   
@Override
public Void visitContinue(ContinueTree node, Void unused) {
    sync(node);
    builder.open(plusFour);
    token("continue");
    if (node.getLabel() != null) {
        builder.breakOp(" ");
        visit(node.getLabel());
    }
    token(";");
    builder.close();
    return null;
}
项目:error-prone    文件:Matchers.java   
/** Matches a {@code continue} statement. */
public static Matcher<StatementTree> continueStatement() {
  return new Matcher<StatementTree>() {
    @Override
    public boolean matches(StatementTree statementTree, VisitorState state) {
      return statementTree instanceof ContinueTree;
    }
  };
}
项目:error-prone    文件:ErrorProneScanner.java   
@Override
public Void visitContinue(ContinueTree tree, VisitorState visitorState) {
  VisitorState state = visitorState.withPath(getCurrentPath());
  for (ContinueTreeMatcher matcher : continueMatchers) {
    if (!isSuppressed(matcher, state)) {
      try {
        reportMatch(matcher.matchContinue(tree, state), tree, state);
      } catch (Throwable t) {
        handleError(matcher, t);
      }
    }
  }
  return super.visitContinue(tree, state);
}
项目:error-prone    文件:UContinue.java   
@Override
public Choice<Unifier> visitContinue(ContinueTree node, Unifier unifier) {
  if (getLabel() == null) {
    return Choice.condition(node.getLabel() == null, unifier);
  } else {
    CharSequence boundName = unifier.getBinding(key());
    return Choice.condition(
        boundName != null && node.getLabel().contentEquals(boundName), unifier);
  }
}
项目:error-prone    文件:ControlFlowVisitor.java   
@Override
public Result visitContinue(ContinueTree node, BreakContext cxt) {
  if (cxt.internalLabels.contains(node.getLabel())
      || (node.getLabel() == null && cxt.loopDepth > 0)) {
    return NEVER_EXITS;
  } else {
    return MAY_BREAK_OR_RETURN;
  }
}
项目:error-prone    文件:Finally.java   
@Override
public Description matchContinue(ContinueTree tree, VisitorState state) {
  if (new FinallyJumpMatcher((JCContinue) tree).matches(tree, state)) {
    return describeMatch(tree);
  }
  return Description.NO_MATCH;
}
项目:error-prone-aspirator    文件:Finally.java   
@Override
public Description matchContinue(ContinueTree tree, VisitorState state) {
  if (new FinallyJumpMatcher((JCContinue) tree).matches(tree, state)) {
    return describeMatch(tree, NO_FIX);
  }
  return Description.NO_MATCH;
}
项目:bazel    文件:CFGBuilder.java   
@Override
public Node visitContinue(ContinueTree tree, Void p) {
    Name label = tree.getLabel();
    if (label == null) {
        assert continueTargetL != null : "no target for continue statement";

        extendWithExtendedNode(new UnconditionalJump(continueTargetL));
    } else {
        assert continueLabels.containsKey(label);

        extendWithExtendedNode(new UnconditionalJump(continueLabels.get(label)));
    }

    return null;
}
项目:compile-testing    文件:TreeDiffer.java   
@Override
public Void visitContinue(ContinueTree expected, Tree actual) {
  Optional<ContinueTree> other = checkTypeAndCast(expected, actual);
  if (!other.isPresent()) {
    addTypeMismatch(expected, actual);
    return null;
  }

  checkForDiff(namesEqual(expected.getLabel(), other.get().getLabel()),
      "Expected label on continue statement to be <%s> but was <%s>.",
      expected.getLabel(), other.get().getLabel());
  return null;
}
项目:compile-testing    文件:MoreTrees.java   
@Override
public Optional<TreePath> visitContinue(@Nullable ContinueTree node, Void v) {
  if (node == null) {
    return Optional.absent();
  } else if (isMatch(node, node.getLabel())) {
    return currentPathPlus(node);
  }

  return super.visitContinue(node, v);
}
项目:incubator-netbeans    文件:NCLOCVisitor.java   
@Override
public Object visitContinue(ContinueTree node, Object p) {
    statements++;
    return super.visitContinue(node, p);
}
项目:incubator-netbeans    文件:CyclomaticComplexityVisitor.java   
@Override
public Object visitContinue(ContinueTree node, Object p) {
    complexity++;
    return super.visitContinue(node, p);
}
项目:incubator-netbeans    文件:InfiniteRecursion.java   
@Override
public State visitContinue(ContinueTree node, Void p) {
    StatementTree target = ci.getTreeUtilities().getBreakContinueTarget(getCurrentPath());
    breakContinueJumps.add(target);
    return State.NO;
}
项目:incubator-netbeans    文件:Flow.java   
public Boolean visitContinue(ContinueTree node, ConstructorData p) {
    StatementTree loop = info.getTreeUtilities().getBreakContinueTarget(getCurrentPath());

    if (loop == null) {
        super.visitContinue(node, p);
        return null;
    }

    Tree resumePoint;

    if (loop.getKind() == Kind.LABELED_STATEMENT) {
        loop = ((LabeledStatementTree) loop).getStatement();
    }

    switch (loop.getKind()) {
        case WHILE_LOOP:
            resumePoint = ((WhileLoopTree) loop).getCondition();
            break;
        case FOR_LOOP: {
                ForLoopTree flt = (ForLoopTree)loop;
                resumePoint = null;
                if (flt.getUpdate() != null && !flt.getUpdate().isEmpty()) {
                    // resume will react on the 1st Tree of the update statement (always processed left to right)
                    resumePoint = flt.getUpdate().get(0);
                } 
                if (resumePoint == null) {
                    resumePoint = flt.getCondition();
                }
                if (resumePoint == null) {
                    resumePoint = flt.getStatement();
                }
        }
            break;
        case DO_WHILE_LOOP:
            resumePoint = ((DoWhileLoopTree) loop).getCondition();
            break;
        case ENHANCED_FOR_LOOP:
            resumePoint = ((EnhancedForLoopTree) loop).getStatement();
            break;
        default:
            resumePoint = null;
            break;
    }

    if (resumePoint != null) {
        recordResume(resumeBefore, resumePoint, variable2State);
    }

    variable2State = new HashMap< Element, State>();

    super.visitContinue(node, p);
    return null;
}
项目:incubator-netbeans    文件:Utilities.java   
@Override
public Boolean visitContinue(ContinueTree node, Void p) {
    return visitBreak(null, p);
}
项目:incubator-netbeans    文件:ExpectedTypeResolver.java   
@Override
public List<? extends TypeMirror> visitContinue(ContinueTree node, Object p) {
    return null;
}
项目:openjdk-jdk10    文件:CompletenessStressTest.java   
private boolean isLegal(StatementTree st) {
    return !(st instanceof ReturnTree) &&
            !(st instanceof ContinueTree) && !(st instanceof BreakTree);
}
项目:openjdk9    文件:CompletenessStressTest.java   
private boolean isLegal(StatementTree st) {
    return !(st instanceof ReturnTree) &&
            !(st instanceof ContinueTree) && !(st instanceof BreakTree);
}
项目:oblivion-netbeans-plugin    文件:ApexTreeVisitorAdapter.java   
@Override
public R visitContinue(ContinueTree ct, P p) {
    return null;
}
项目:oblivion-netbeans-plugin    文件:TreeFinder.java   
@Override
public List<T> visitContinue(ContinueTree node, T p) {
    return checkForCriteria(node);
}
项目:oblivion-netbeans-plugin    文件:ApexTreeFactory.java   
@Override
public ContinueTree createContinue() {
    return new ContinueTreeImpl();
}
项目:adalid    文件:CodeAnalyzerTreeVisitor.java   
@Override
public Object visitContinue(ContinueTree t, Trees p) {
    info("ContinueTree" + CL + t.getKind() + SP + t);
    return super.visitContinue(t, p);
}
项目:error-prone    文件:Reachability.java   
@Override
public Boolean visitContinue(ContinueTree tree, Void unused) {
  continues.add(skipLabel(requireNonNull(((JCTree.JCContinue) tree).target)));
  return false;
}
项目:error-prone    文件:UTemplater.java   
@Override
public UContinue visitContinue(ContinueTree tree, Void v) {
  return UContinue.create(tree.getLabel());
}
项目:kan-java    文件:VisitContinueHook.java   
void visit(ContinueTree node, List<ErrMsg> errMsgs, GlobalContext globalCtx, Closure<List<Map<String, Long>>> resolveRowAndCol,
Closure<Void> setError);
项目:checker-framework    文件:PurityChecker.java   
@Override
public PurityResult visitContinue(ContinueTree node, PurityResult p) {
    return p;
}
项目:bazel    文件:PurityChecker.java   
@Override
public PurityResult visitContinue(ContinueTree node, PurityResult p) {
    return p;
}
项目:compile-testing    文件:Breadcrumbs.java   
@Override
public String visitContinue(ContinueTree reference, Void v) {
  return (reference != null) ? detailedKindString(reference, reference.getLabel()) : "";
}
项目:yield4j    文件:JavaTreeBuilderNew.java   
@Override
public Wrapper visitContinue(ContinueTree arg0, Void arg1) {
    Name label = arg0.getLabel();
    return new ContinueWrapper(arg0, label != null ? label.toString()
            : null);
}