@Test void foreach_loop_continue() { final CFG cfg = buildCFG("void fun(){ System.out.println(\"start\"); for(String foo:list) {System.out.println(foo); if(foo.length()> 2) {continue;} System.out.println('c');} System.out.println(\"end\"); }"); final CFGChecker cfgChecker = checker( block( element(Tree.Kind.IDENTIFIER, "System"), element(Tree.Kind.MEMBER_SELECT), element(Tree.Kind.STRING_LITERAL, "start"), element(Tree.Kind.METHOD_INVOCATION)).successors(6), block( element(Tree.Kind.IDENTIFIER, "list")).successors(2), block( element(Tree.Kind.IDENTIFIER, "System"), element(Tree.Kind.MEMBER_SELECT), element(Tree.Kind.IDENTIFIER, "foo"), element(Kind.METHOD_INVOCATION), element(Tree.Kind.IDENTIFIER, "foo"), element(Kind.METHOD_INVOCATION), element(INT_LITERAL, 2), element(Kind.GREATER_THAN) ).terminator(Kind.IF_STATEMENT).successors(3, 4), terminator(Kind.CONTINUE_STATEMENT).successors(2).successorWithoutJump(3), block( element(Tree.Kind.IDENTIFIER, "System"), element(Tree.Kind.MEMBER_SELECT), element(Tree.Kind.CHAR_LITERAL, "'c'"), element(Tree.Kind.METHOD_INVOCATION)).successors(2), block( element(Tree.Kind.VARIABLE, "foo")).terminator(Tree.Kind.FOR_EACH_STATEMENT).successors(1, 5), block( element(Tree.Kind.IDENTIFIER, "System"), element(Tree.Kind.MEMBER_SELECT), element(Tree.Kind.STRING_LITERAL, "end"), element(Tree.Kind.METHOD_INVOCATION)).successors(0)); cfgChecker.check(cfg); }
public static CFG buildCFG(List<? extends Tree> trees, boolean ignoreBreak) { return new CFG(trees, null, ignoreBreak); }
CFG implements ControlFlowGraph { public static CFG buildCFG(List<? extends Tree> trees, boolean ignoreBreak) { return new CFG(trees, null, ignoreBreak); } }
CFG implements ControlFlowGraph { public static CFG buildCFG(List<? extends Tree> trees, boolean ignoreBreak) { return new CFG(trees, null, ignoreBreak); } private  CFG(List<? extends Tree> trees, @Nullable Symbol.MethodSymbol symbol, boolean ignoreBreakAndContinue); }
CFG implements ControlFlowGraph { public static CFG buildCFG(List<? extends Tree> trees, boolean ignoreBreak) { return new CFG(trees, null, ignoreBreak); } private  CFG(List<? extends Tree> trees, @Nullable Symbol.MethodSymbol symbol, boolean ignoreBreakAndContinue); @Override Block exitBlock(); @Nullable Symbol.MethodSymbol methodSymbol(); @Override Block entryBlock(); @Override List<Block> blocks(); List<Block> reversedBlocks(); static CFG buildCFG(List<? extends Tree> trees, boolean ignoreBreak); static CFG buildCFG(List<? extends Tree> trees); static CFG build(MethodTree tree); void setMethodSymbol(Symbol.MethodSymbol methodSymbol); }
CFG implements ControlFlowGraph { public static CFG buildCFG(List<? extends Tree> trees, boolean ignoreBreak) { return new CFG(trees, null, ignoreBreak); } private  CFG(List<? extends Tree> trees, @Nullable Symbol.MethodSymbol symbol, boolean ignoreBreakAndContinue); @Override Block exitBlock(); @Nullable Symbol.MethodSymbol methodSymbol(); @Override Block entryBlock(); @Override List<Block> blocks(); List<Block> reversedBlocks(); static CFG buildCFG(List<? extends Tree> trees, boolean ignoreBreak); static CFG buildCFG(List<? extends Tree> trees); static CFG build(MethodTree tree); void setMethodSymbol(Symbol.MethodSymbol methodSymbol);  }