void (@NotNull PsiVariable variable, @NotNull ComponentContext context, @NotNull ProblemsHolder holder) { PsiIdentifier[] identifiers = PsiTreeUtil.getChildrenOfType(variable, PsiIdentifier.class); if (identifiers == null || identifiers.length != 1) { return; } PsiIdentifier identifier = identifiers[0]; LocalQuickFix localQuickFix = getLocalQuickFix(context); if (context.showInfoFolder.showInfo) { holder.registerProblem(identifier, InspectionGadgetsBundle.message("inspection.enhanced.for.with.record.pattern.can.be.used.message"), ProblemHighlightType.INFORMATION, localQuickFix); } else { List<LocalQuickFix> fixes = new ArrayList<>(); fixes.add(localQuickFix); int length = context.recordClass.getRecordComponents().length; if (length > 1) { fixes.add( LocalQuickFix.from(new UpdateInspectionOptionFix( ForEachWithRecordPatternCanBeUsedInspection.this, "maxComponentCounts", InspectionGadgetsBundle.message("inspection.enhanced.for.with.record.pattern.can.be.used.maximum.number.disabled", length), length - 1))); } Integer level = context.level; if (level != null && level > 0) { fixes.add(LocalQuickFix.from(new UpdateInspectionOptionFix( ForEachWithRecordPatternCanBeUsedInspection.this, "maxLevel", InspectionGadgetsBundle.message("inspection.enhanced.for.with.record.pattern.can.be.used.maximum.depth.disabled", level), level - 1))); } holder.registerProblem(identifier, InspectionGadgetsBundle.message("inspection.enhanced.for.with.record.pattern.can.be.used.message"), fixes.toArray(LocalQuickFix.EMPTY_ARRAY)); } }