@Test void try_statement_with_checked_exceptions() { CFG cfg = buildCFG( " void foo(Object result) {" + " try { " + " result = new Plop();" + " } catch(IllegalAccessException iae) {" + " try{ " + " result = new Plop();" + " } catch(IllegalAccessException iae2) {" + " }" + " result.toString(); " + " }" + "}" + "" + "class Plop{" + " Plop() throws IllegalAccessException{}" + "}" ); CFGChecker cfgChecker = checker( block( element(Tree.Kind.TRY_STATEMENT)).successors(7), block( element(Kind.NEW_CLASS)).successors(1).exceptions(0, 6), block( element(Kind.VARIABLE, "iae"), element(Tree.Kind.TRY_STATEMENT)).successors(5).isCatchBlock(), block( element(Kind.NEW_CLASS)).successors(3).exceptions(0, 4), block( element(Kind.VARIABLE, "iae2") ).successors(2), block( element(Kind.ASSIGNMENT) ).successors(2), block( element(Kind.IDENTIFIER, "result"), element(Kind.METHOD_INVOCATION) ).successors(0).exceptions(0), block( element(Kind.ASSIGNMENT) ).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);  }