ModCommand (@NotNull PsiMethod method) { PsiModifierList modifierList = method.getModifierList(); assert modifierList != null; PsiModifierList copy = (PsiModifierList)modifierList.copy(); changeModifierList(copy); final int accessLevel = PsiUtil.getAccessLevel(copy); if (accessLevel == PsiUtil.getAccessLevel(modifierList)) return ModCommand.nop(); final List<PsiModifierList> modifierLists = new ArrayList<>(); OverridingMethodsSearch.search(method, method.getResolveScope(), true).forEach( new PsiElementProcessorAdapter<>(new PsiElementProcessor<>() { @Override public boolean execute(@NotNull PsiMethod inheritor) { PsiModifierList list = inheritor.getModifierList(); if (BaseIntentionAction.canModify(inheritor) && PsiUtil.getAccessLevel(list) < accessLevel) { modifierLists.add(list); } return true; } })); if (modifierLists.isEmpty()) { return ModCommand.psiUpdate(method, this::updateModifier); } if (myProcessHierarchy == ThreeState.YES) { return ModCommand.psiUpdate(method, (writableMethod, updater) -> { for (PsiModifierList list : ContainerUtil.map(modifierLists, updater::getWritable)) { changeModifierList(list); } updateModifier(writableMethod); }); } else { return new ModChooseAction(getFamilyName(), List.of( new ModifierFix(method, myModifier, myShouldHave, myShowContainingClass, ThreeState.YES), new ModifierFix(method, myModifier, myShouldHave, myShowContainingClass, ThreeState.NO) )); } }