void (PsiMethod ctor) { PsiCodeBlock body = ctor.getBody(); if (body == null) return; PsiIdentifier ctorNameIdentifier = ctor.getNameIdentifier(); if (ctorNameIdentifier == null) return; PsiStatement[] statements = body.getStatements(); if (statements.length > 0) { PsiParameter[] parameters = ctor.getParameterList().getParameters(); PsiRecordComponent[] components = Objects.requireNonNull(ctor.getContainingClass()).getRecordComponents(); int count = getAssignedComponentsCount(components, parameters, statements); if (count < statements.length) { for (int i = statements.length - count; i < statements.length; i++) { holder.problem(statements[i], JavaBundle.message("inspection.redundant.record.constructor.statement.message")) .fix(new DeleteElementFix(statements[i])).register(); } return; } } if (ctor.getModifierList().getAnnotations().length == 0 && ctor.getDocComment() == null) { holder.registerProblem(ctorNameIdentifier, JavaBundle.message("inspection.redundant.record.constructor.compact.message"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new RemoveRedundantCtorSimplifier()); } }