boolean (@NotNull PsiTryStatement targetStatement, boolean returnAtTheEnd) { PsiCodeBlock tryBlock = targetStatement.getTryBlock(); if (tryBlock == null) { return false; } PsiCodeBlock finallyBlock = targetStatement.getFinallyBlock(); if (isVariableUsed(flow, finallyBlock, resultVariable)) { return false; } boolean allCatchesReturn = true; PsiCatchSection[] catchSections = targetStatement.getCatchSections(); for (PsiCatchSection catchSection : catchSections) { PsiCodeBlock catchBlock = catchSection.getCatchBlock(); if (catchBlock == null || !moveToBlockBody(catchBlock, false)) { allCatchesReturn = false; } } return moveToBlockBody(tryBlock, returnAtTheEnd && allCatchesReturn) && allCatchesReturn; }