void (@NotNull PsiContinueStatement statement) { final PsiStatement continuedStatement = statement.findContinuedStatement(); PsiStatement body = null; if (continuedStatement instanceof PsiLoopStatement loopStatement) { body = loopStatement.getBody(); } if (body == null) { return; } if (ignoreInThenBranch && UnnecessaryReturnInspection.isInThenBranch(statement)) { return; } if (ControlFlowUtils.isInFinallyBlock(statement, continuedStatement)) { return; } if (body instanceof PsiBlockStatement blockStatement) { final PsiCodeBlock block = blockStatement.getCodeBlock(); if (ControlFlowUtils.blockCompletesWithStatement(block, statement)) { registerError(statement.getFirstChild()); } } else if (ControlFlowUtils.statementCompletesWithStatement(body, statement)) { registerError(statement.getFirstChild()); } }