in src/main/java/com/intellij/rt/debugger/agent/CollectionBreakpointInstrumentor.java [594:617]
private void addTryCatchCode() {
LabelNode startTryCatch = new LabelNode();
LabelNode endTryCatch = new LabelNode();
LabelNode handlerTryCatch = new LabelNode();
AbstractInsnNode firstIns = instructions.getFirst();
if (firstIns != null) {
instructions.insertBefore(firstIns, startTryCatch);
}
else {
instructions.add(startTryCatch);
}
InsnList additionalInstructions = new InsnList();
additionalInstructions.add(endTryCatch);
additionalInstructions.add(handlerTryCatch);
addEndCaptureInstructions(additionalInstructions);
additionalInstructions.add(new InsnNode(Opcodes.ATHROW));
instructions.add(additionalInstructions);
TryCatchBlockNode tryCatchBlockNode = new TryCatchBlockNode(startTryCatch, endTryCatch, handlerTryCatch, null);
tryCatchBlocks.add(tryCatchBlockNode);
}