//
for (final ControlFlowNode node : _nodes) {
if (node.getNodeType() == ControlFlowNodeType.Normal) {
final Instruction end = node.getEnd();
final ExceptionHandler innermostHandler = findInnermostExceptionHandler(node.getEnd().getOffset());
if (innermostHandler != null) {
for (final ExceptionHandler other : _handlerPlaceholders) {
if (other.getTryBlock().equals(innermostHandler.getTryBlock())) {
final ControlFlowNode handlerNode = firstOrDefault(
_nodes,
new Predicate<ControlFlowNode>() {
@Override
public boolean test(final ControlFlowNode node) {
return node.getExceptionHandler() == other;
}
}
);
if (node != handlerNode) {
createEdge(node, handlerNode, JumpType.JumpToExceptionHandler);
}
}
}
}
else if (end.getOpCode() == OpCode.ATHROW) {
createEdge(node, _exceptionalExit, JumpType.JumpToExceptionHandler);
}
}
final ExceptionHandler exceptionHandler = node.getExceptionHandler();
if (exceptionHandler != null) {
final ControlFlowNode parentHandler = findParentExceptionHandlerNode(node);
if (parentHandler.getNodeType() != ControlFlowNodeType.ExceptionalExit) {
for (final ExceptionHandler other : _handlerPlaceholders) {
if (Comparer.equals(other.getTryBlock(), parentHandler.getExceptionHandler().getTryBlock())) {
final ControlFlowNode handlerNode = firstOrDefault(
_nodes,
new Predicate<ControlFlowNode>() {
@Override
public boolean test(final ControlFlowNode node) {
return node.getExceptionHandler() == other;
}
}
);
if (handlerNode != node) {
createEdge(node, handlerNode, JumpType.JumpToExceptionHandler);
}
}
}
}
createEdge(
node,
exceptionHandler.getHandlerBlock().getFirstInstruction(),
JumpType.Normal
);
}
}
}