ModCommand (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiElement element = descriptor.getPsiElement(); final PsiClass containingClass = findClassToFix(element); if (containingClass == null) { return ModCommand.nop(); } final PsiModifierList modifierList = containingClass.getModifierList(); assert modifierList != null; final List<String> conflictMessages = new ArrayList<>(); if (!IntentionPreviewUtils.isIntentionPreviewActive()) { final Query<PsiClass> search = ClassInheritorsSearch.search(containingClass); search.forEach(aClass -> { conflictMessages.add(InspectionGadgetsBundle .message("0.will.no.longer.be.overridable.by.1", RefactoringUIUtil.getDescription(containingClass, false), RefactoringUIUtil.getDescription(aClass, false))); return true; }); } ModShowConflicts.Conflict conflict = new ModShowConflicts.Conflict(conflictMessages); return new ModShowConflicts(Map.of(containingClass, conflict), ModCommand.psiUpdate(modifierList, list -> doMakeFinal(list))); }