@Test void switch_statement_without_default() { final CFG cfg = buildCFG("void fun(int foo) {\n" + " int a;\n" + " switch (foo) {\n" + " case 1:\n" + " System.out.println(bar);\n" + " case 2:\n" + " System.out.println(qix);\n" + " break;\n" + " }\n" + " Integer.toString(foo);\n" + " }"); final CFGChecker cfgChecker = checker( block( element(Tree.Kind.CASE_GROUP), element(Tree.Kind.IDENTIFIER, "System"), element(Tree.Kind.MEMBER_SELECT), element(Tree.Kind.IDENTIFIER, "bar"), element(Tree.Kind.METHOD_INVOCATION)).hasCaseGroup().successors(3), block( element(Tree.Kind.CASE_GROUP), element(Tree.Kind.IDENTIFIER, "System"), element(Tree.Kind.MEMBER_SELECT), element(Tree.Kind.IDENTIFIER, "qix"), element(Tree.Kind.METHOD_INVOCATION)).terminator(Tree.Kind.BREAK_STATEMENT).hasCaseGroup().successors(1), block( element(Tree.Kind.VARIABLE, "a"), element(Tree.Kind.IDENTIFIER, "foo"), element(Tree.Kind.INT_LITERAL, 1), element(Tree.Kind.INT_LITERAL, 2)).terminator(Tree.Kind.SWITCH_STATEMENT).successors(1, 3, 4), block( element(Tree.Kind.IDENTIFIER, "Integer"), element(Tree.Kind.IDENTIFIER, "foo"), 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);  }