private void collectNodes(final ControlFlowNode node) { if (node == end || node == newEnd) { throw new IllegalStateException("Unexpected cycle involving finally constructs!"); } if (oldToNew.containsKey(node)) { return; } final int newBlockIndex = _nodes.size(); final ControlFlowNode copy; switch (node.getNodeType()) { case Normal: copy = new ControlFlowNode(newBlockIndex, node.getStart(), node.getEnd()); break; case FinallyHandler: copy = new ControlFlowNode(newBlockIndex, node.getExceptionHandler(), node.getEndFinallyNode()); break; default: throw ContractUtils.unsupported(); } copy.setCopyFrom(node); _nodes.add(copy); oldToNew.put(node, copy); if (node != start) { for (final ControlFlowNode predecessor : node.getPredecessors()) { collectNodes(predecessor); } } }
private void collectNodes(final ControlFlowNode node) { if (node == end || node == newEnd) { throw new IllegalStateException("Unexpected cycle involving finally constructs!"); } if (oldToNew.containsKey(node)) { return; } final int newBlockIndex = _nodes.size(); final ControlFlowNode copy; switch (node.getNodeType()) { case Normal: copy = new ControlFlowNode(newBlockIndex, node.getStart(), node.getEnd()); break; case FinallyHandler: copy = new ControlFlowNode(newBlockIndex, node.getExceptionHandler(), node.getEndFinallyNode()); break; default: throw ContractUtils.unsupported(); } copy.setCopyFrom(node); _nodes.add(copy); oldToNew.put(node, copy); if (node != start) { for (final ControlFlowNode predecessor : node.getPredecessors()) { collectNodes(predecessor); } } }
private void collectNodes(final ControlFlowNode node) { if (node == end || node == newEnd) { throw new IllegalStateException("Unexpected cycle involving finally constructs!"); } if (oldToNew.containsKey(node)) { return; } final int newBlockIndex = _nodes.size(); final ControlFlowNode copy; switch (node.getNodeType()) { case Normal: copy = new ControlFlowNode(newBlockIndex, node.getStart(), node.getEnd()); break; case FinallyHandler: copy = new ControlFlowNode(newBlockIndex, node.getExceptionHandler(), node.getEndFinallyNode()); break; default: throw ContractUtils.unsupported(); } copy.setCopyFrom(node); _nodes.add(copy); oldToNew.put(node, copy); if (node != start) { for (final ControlFlowNode predecessor : node.getPredecessors()) { collectNodes(predecessor); } } }