@Test void throw_statement_within_try_catch() { CFG cfg = buildCFG("void fun() { try {throw new MyException();} catch(MyException me){foo();} bar();} class MyException extends Exception{}"); CFGChecker cfgChecker = checker( block(element(TRY_STATEMENT)).successors(4), block(element(NEW_CLASS)).successors(3).exceptions(0), terminator(THROW_STATEMENT).successors(2), block(element(VARIABLE, "me"), element(IDENTIFIER, "foo"), element(METHOD_INVOCATION)).successors(1).exceptions(0), block(element(IDENTIFIER, "bar"), element(METHOD_INVOCATION)).successors(0) ); cfgChecker.check(cfg); cfg = buildCFG("void fun() { try {throw new MyException();} catch(MySuperException me){foo();} bar();} class MyException extends MySuperException{} class MySuperException extends Exception{}"); cfgChecker = checker( block(element(TRY_STATEMENT)).successors(4), block(element(NEW_CLASS)).successors(3).exceptions(0), terminator(THROW_STATEMENT).successors(2), block(element(VARIABLE, "me"), element(IDENTIFIER, "foo"), element(METHOD_INVOCATION)).successors(1).exceptions(0), block(element(IDENTIFIER, "bar"), element(METHOD_INVOCATION)).successors(0) ); cfgChecker.check(cfg); cfg = buildCFG("void fun() { throw new MyException(); bar();} class MyException extends MySuperException{}"); cfgChecker = checker( block(element(NEW_CLASS)).terminator(THROW_STATEMENT).successors(0), block(element(IDENTIFIER, "bar"), element(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);  }