void (MemberInfo info) { PsiModifierListOwner modifierListOwner = info.getMember(); if (myIsTargetInterface) { PsiUtil.setModifierProperty(modifierListOwner, PsiModifier.PUBLIC, true); } else if (modifierListOwner.hasModifierProperty(PsiModifier.PRIVATE)) { if (info.isToAbstract() || willBeUsedInSubclass(modifierListOwner, myTargetSuperClass, mySourceClass)) { PsiUtil.setModifierProperty(modifierListOwner, PsiModifier.PROTECTED, true); } if (modifierListOwner instanceof PsiClass) { modifierListOwner.accept(new JavaRecursiveElementWalkingVisitor() { @Override public void visitMethod(@NotNull PsiMethod method) { check(method); } @Override public void visitField(@NotNull PsiField field) { check(field); } @Override public void visitClass(@NotNull PsiClass aClass) { check(aClass); super.visitClass(aClass); } private void check(PsiMember member) { if (member.hasModifierProperty(PsiModifier.PRIVATE)) { if (willBeUsedInSubclass(member, myTargetSuperClass, mySourceClass)) { PsiUtil.setModifierProperty(member, PsiModifier.PROTECTED, true); } } } }); } } }