@Test void exception_raised_in_catch() throws Exception { CFG cfg = buildCFG("private void fun() {\n" + " try {\n" + " try {\n" + " f();\n" + " } catch (Exception e) {\n" + " ex();\n" + " } finally {\n" + " fin();\n" + " }\n" + " } catch (Exception e) {\n" + " outEx();\n" + " }\n"+ "} " ); CFGChecker cfgChecker = checker( block(element(TRY_STATEMENT)), block(element(TRY_STATEMENT)), block( element(IDENTIFIER, "f"), element(METHOD_INVOCATION) ).exceptions(2,3), block( element(VARIABLE, "e"), element(IDENTIFIER, "ex"), element(METHOD_INVOCATION) ).exceptions(2), block( element(IDENTIFIER, "fin"), element(METHOD_INVOCATION) ).exceptions(0,1), block( element(VARIABLE, "e"), element(IDENTIFIER, "outEx"), element(METHOD_INVOCATION) ).exceptions(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);  }