void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { final PsiModifierListOwner element = PsiTreeUtil.getParentOfType(startElement, PsiModifierListOwner.class); if (element != null) { if (element instanceof PsiVariable variable) { variable.normalizeDeclaration(); } PsiModifierList list = element.getModifierList(); LOG.assertTrue(list != null); if (element instanceof PsiMethod psiMethod) { PsiClass containingClass = psiMethod.getContainingClass(); if (containingClass != null && containingClass.getParent() instanceof PsiFile && PsiModifier.PRIVATE.equals(myHint) && list.hasModifierProperty(PsiModifier.FINAL)) { list.setModifierProperty(PsiModifier.FINAL, false); } } list.setModifierProperty(myHint, true); } }