);
}
// Collections.sort(entries);
final ControlFlowGraph cfg = ControlFlowGraphBuilder.build(body, Collections.<ExceptionHandler>emptyList());
cfg.computeDominance();
cfg.computeDominanceFrontier();
final List<ControlFlowNode> nodes = cfg.getNodes();
final Map<Instruction, ControlFlowNode> nodeLookup = new IdentityHashMap<>();
for (int j = 0; j < nodes.size(); j++) {
final ControlFlowNode node = nodes.get(j);
if (node.getNodeType() != ControlFlowNodeType.Normal) {
continue;
}
for (Instruction i = node.getStart();
i != null && i.getOffset() < node.getEnd().getEndOffset();
i = i.getNext()) {
nodeLookup.put(i, node);
}
}
for (int i = 0; i < entries.size(); i++) {
int minOffset = Integer.MAX_VALUE;
final HandlerWithRange entry = entries.get(i);
ControlFlowNode tryEnd = null;
for (int j = 0; j < nodes.size(); j++) {
final ControlFlowNode node = nodes.get(j);
final Instruction end = node.getEnd();
if (end != null && end.getOffset() == entry.entry.getEndOffset()) {
final Instruction previousInstruction = node.getStart().getPrevious();
final HandlerWithRange nearestHandler = findNearestHandler(entries, entry);
final Instruction firstHandlerInstruction = body.atOffset(nearestHandler.range.getStart());
if (end.getOpCode() == OpCode.GOTO && end.getNext() == firstHandlerInstruction) {
tryEnd = nodeLookup.get(end);
}
else if (previousInstruction != null) {
tryEnd = nodeLookup.get(previousInstruction);
}
break;
}
}
for (int j = 0; j < nodes.size(); j++) {
final ControlFlowNode node = nodes.get(j);
if (node.getNodeType() != ControlFlowNodeType.Normal) {
continue;
}
if (node.getStart().getOffset() == entry.range.getStart()) {
final ControlFlowNode end = findHandlerEnd(node, tryEnd, new LinkedHashSet<ControlFlowNode>(), cfg.getRegularExit());
if (end != null && end.getNodeType() == ControlFlowNodeType.Normal) {
minOffset = end.getEnd().getEndOffset();
}
else {