@Test void successor_of_labeled_break_statement() throws Exception { CFG cfg = buildCFG("private static void test(long toRevision, boolean inverted, Object visitor) {\n" + "\n" + " testBlock: {\n" + " if (inverted) \n" + " break testBlock;\n" + " test(0, false ? inverted : !inverted, visitor);\n" + " }\n" + " }"); CFGChecker cfgChecker = checker( block( element(Kind.IDENTIFIER, "inverted") ).terminator(Kind.IF_STATEMENT) .ifTrue(5) .ifFalse(4), terminator(Kind.BREAK_STATEMENT).successors(0), block( element(Kind.IDENTIFIER, "test"), element(INT_LITERAL, 0), element(Kind.BOOLEAN_LITERAL, "false") ).terminator(Kind.CONDITIONAL_EXPRESSION) .ifTrue(3) .ifFalse(2), block( element(Kind.IDENTIFIER, "inverted") ).successors(1), block( element(Kind.IDENTIFIER, "inverted"), element(Kind.LOGICAL_COMPLEMENT) ).successors(1), block( element(Kind.IDENTIFIER, "visitor"), element(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);  }