boolean (PsiCodeBlock codeBlock, @Nullable Predicate<? super PsiStatement> trivialPredicate) { if (codeBlock == null) { return true; } final PsiStatement[] statements = codeBlock.getStatements(); for (PsiStatement statement : statements) { ProgressManager.checkCanceled(); if (statement instanceof PsiEmptyStatement || trivialPredicate != null && trivialPredicate.test(statement)) { continue; } if (statement instanceof PsiReturnStatement returnStatement) { final PsiExpression returnValue = PsiUtil.skipParenthesizedExprDown(returnStatement.getReturnValue()); if (returnValue != null && !(returnValue instanceof PsiLiteralExpression)) { return false; } } else if (statement instanceof PsiIfStatement ifStatement) { final PsiExpression condition = ifStatement.getCondition(); final Object result = ExpressionUtils.computeConstantExpression(condition); if (result == null || !result.equals(Boolean.FALSE)) { return false; } } else if (statement instanceof PsiExpressionStatement expressionStatement) { if (!JavaPsiConstructorUtil.isSuperConstructorCall(expressionStatement.getExpression())) { return false; } } else { return false; } } return true; }