return findInnermostHandlerBlock(instructionOffset, true);
}
private ControlFlowNode findInnermostHandlerBlock(final int instructionOffset, final boolean finallyOnly) {
ExceptionHandler result = null;
InstructionBlock resultBlock = null;
for (final ExceptionHandler handler : _exceptionHandlers) {
if (finallyOnly && handler.isCatch()) {
continue;
}
final InstructionBlock handlerBlock = handler.getHandlerBlock();
if (handlerBlock.getFirstInstruction().getOffset() <= instructionOffset &&
instructionOffset < handlerBlock.getLastInstruction().getEndOffset() &&
(resultBlock == null || isNarrower(handler.getHandlerBlock(), resultBlock))) {
result = handler;
resultBlock = handlerBlock;
}
}
final ControlFlowNode innerMost = finallyOnly ? findInnermostExceptionHandlerNode(instructionOffset)
: findInnermostFinallyHandlerNode(instructionOffset);
final ExceptionHandler innerHandler = innerMost.getExceptionHandler();
final InstructionBlock innerBlock = innerHandler != null ? innerHandler.getTryBlock() : null;
if (innerBlock != null && (resultBlock == null || isNarrower(innerBlock, resultBlock))) {
result = innerHandler;
}