void (MemberInfo info) { PsiModifierListOwner modifierListOwner = info.getMember(); if (myTargetSuperClass.isInterface()) { PsiUtil.setModifierProperty(modifierListOwner, PsiModifier.PUBLIC, true); } else if (modifierListOwner.hasModifierProperty(PsiModifier.PRIVATE)) { if (info.isToAbstract() || willBeUsedInSubclass(modifierListOwner, myMembersToMove, myTargetSuperClass, mySourceClass)) { PsiUtil.setModifierProperty(modifierListOwner, PsiModifier.PROTECTED, true); } if (modifierListOwner instanceof GrTypeDefinition) { ((GrTypeDefinition)modifierListOwner).accept(new GroovyRecursiveElementVisitor() { @Override public void visitMethod(@NotNull GrMethod method) { check(method); } @Override public void visitField(@NotNull GrField field) { check(field); } @Override public void visitTypeDefinition(@NotNull GrTypeDefinition typeDefinition) { check(typeDefinition); super.visitTypeDefinition(typeDefinition); } private void check(PsiMember member) { if (member.hasModifierProperty(PsiModifier.PRIVATE)) { if (willBeUsedInSubclass(member, myMembersToMove, myTargetSuperClass, mySourceClass)) { PsiUtil.setModifierProperty(member, PsiModifier.PROTECTED, true); } } } }); } } }