@Test public void not_remove_empty_with_many_successors() { ControlFlowGraph cfg = cfgForBlock("" + "try {" + " tryBody( succ = [catchBody] );" + " throw $e;" + "} catch (Type $e) {" + " catchBody1( succ = [finallyBody] );" + "}"); for (CfgBlock cfgBlock : cfg.blocks()) { if (cfgBlock.syntacticSuccessor() != null) { assertThat(cfg.blocks()).contains(cfgBlock.syntacticSuccessor()); } } }
public Set<CfgBlock> blocks() { return blocks; }
ControlFlowGraph { public Set<CfgBlock> blocks() { return blocks; } }
ControlFlowGraph { public Set<CfgBlock> blocks() { return blocks; } ControlFlowGraph(ImmutableSet<CfgBlock> blocks, CfgBlock start, PhpCfgEndBlock end); }
ControlFlowGraph { public Set<CfgBlock> blocks() { return blocks; } ControlFlowGraph(ImmutableSet<CfgBlock> blocks, CfgBlock start, PhpCfgEndBlock end); @VisibleForTesting static ControlFlowGraph build(BlockTree body); @CheckForNull static ControlFlowGraph build(Tree tree, CheckContext context); CfgBlock start(); CfgBlock end(); Set<CfgBlock> blocks(); }
ControlFlowGraph { public Set<CfgBlock> blocks() { return blocks; } ControlFlowGraph(ImmutableSet<CfgBlock> blocks, CfgBlock start, PhpCfgEndBlock end); @VisibleForTesting static ControlFlowGraph build(BlockTree body); @CheckForNull static ControlFlowGraph build(Tree tree, CheckContext context); CfgBlock start(); CfgBlock end(); Set<CfgBlock> blocks(); static final Set<Tree.Kind> KINDS_WITH_CONTROL_FLOW; }