void (@NotNull PsiElement element, boolean atStart) { // optimization: if we just generated all necessary jumps, do not generate it once again if (atStart && element instanceof PsiStatement && element.getParent() instanceof PsiCodeBlock && element.getPrevSibling() != null) { return; } for (int i = myUnhandledExceptionCatchBlocks.size() - 1; i >= 0; i--) { ProgressManager.checkCanceled(); PsiElement block = myUnhandledExceptionCatchBlocks.get(i); // cannot jump to outer catch blocks (belonging to outer try stmt) if current try{} has 'finally' block if (block == null) { if (!myFinallyBlocks.isEmpty()) { break; } else { continue; } } ConditionalThrowToInstruction throwToInstruction = new ConditionalThrowToInstruction(-1); // -1 for init parameter myCurrentFlow.addInstruction(throwToInstruction); if (!patchUncheckedThrowInstructionIfInsideFinally(throwToInstruction, element, block)) { addElementOffsetLater(block, true); } } // generate a jump to the top 'finally' block if (!myFinallyBlocks.isEmpty()) { final PsiElement finallyBlock = myFinallyBlocks.peek().getElement(); ConditionalThrowToInstruction throwToInstruction = new ConditionalThrowToInstruction(-2); myCurrentFlow.addInstruction(throwToInstruction); if (!patchUncheckedThrowInstructionIfInsideFinally(throwToInstruction, element, finallyBlock)) { addElementOffsetLater(finallyBlock, true); } } }