public void moveMembersToBase() throws IncorrectOperationException {
    myMovedMembers = ContainerUtil.newHashSet();
    myMembersAfterMove = ContainerUtil.newHashSet();

    // build aux sets
    for (MemberInfo info : myMembersToMove) {
      myMovedMembers.add(info.getMember());
    }

    final PsiSubstitutor substitutor = upDownSuperClassSubstitutor();

    for (MemberInfo info : myMembersToMove) {
      PullUpHelper<MemberInfo> processor = getProcessor(info);

      LOG.assertTrue(processor != null, info.getMember());
      if (!(info.getMember() instanceof PsiClass) || info.getOverrides() == null) {
        processor.setCorrectVisibility(info);
        processor.encodeContextInfo(info);
      }

      processor.move(info, substitutor);
    }

    for (PsiMember member : myMembersAfterMove) {
      PullUpHelper<MemberInfo> processor = getProcessor(member);
      LOG.assertTrue(processor != null, member);

      processor.postProcessMember(member);

      final JavaRefactoringListenerManager listenerManager =
          JavaRefactoringListenerManager.getInstance(myProject);
      ((JavaRefactoringListenerManagerImpl) listenerManager).fireMemberMoved(mySourceClass, member);
    }
  }
  public void moveMembersToBase() throws IncorrectOperationException {
    final HashSet<PsiMember> movedMembers = ContainerUtil.newHashSet();
    myMembersAfterMove = ContainerUtil.newHashSet();

    // build aux sets
    for (GrMemberInfo info : myMembersToMove) {
      movedMembers.add(info.getMember());
    }

    // correct private member visibility
    for (GrMemberInfo info : myMembersToMove) {
      if (info.getMember() instanceof PsiClass && info.getOverrides() != null) continue;
      setCorrectVisibility(movedMembers, info);
      GroovyChangeContextUtil.encodeContextInfo(info.getMember());
      info.getMember().accept(new QualifiedThisSuperSearcher());
      fixReferencesToStatic(info.getMember(), movedMembers);
    }

    final PsiSubstitutor substitutor = upDownSuperClassSubstitutor();

    // do actual move
    for (GrMemberInfo info : myMembersToMove) {
      if (info.getMember() instanceof PsiMethod) {
        doMoveMethod(substitutor, info);
      } else if (info.getMember() instanceof GrField) {
        doMoveField(substitutor, info);
      } else if (info.getMember() instanceof PsiClass) {
        doMoveClass(substitutor, info);
      }
    }

    ExplicitSuperDeleter explicitSuperDeleter = new ExplicitSuperDeleter();
    for (PsiMember member : myMembersAfterMove) {
      ((GrMember) member).accept(explicitSuperDeleter);
    }
    explicitSuperDeleter.fixSupers();

    final QualifiedThisSuperAdjuster qualifiedThisSuperAdjuster = new QualifiedThisSuperAdjuster();
    for (PsiMember member : myMembersAfterMove) {
      ((GrMember) member).accept(qualifiedThisSuperAdjuster);
    }

    for (PsiMember member : myMembersAfterMove) {
      GroovyChangeContextUtil.decodeContextInfo(member, null, null);
    }

    final JavaRefactoringListenerManagerImpl listenerManager =
        (JavaRefactoringListenerManagerImpl) JavaRefactoringListenerManager.getInstance(myProject);
    for (final PsiMember movedMember : myMembersAfterMove) {
      ((GroovyPsiElement) movedMember)
          .accept(
              new GroovyRecursiveElementVisitor() {
                @Override
                public void visitReferenceExpression(GrReferenceExpression referenceExpression) {
                  if (processRef(referenceExpression)) return;
                  super.visitReferenceExpression(referenceExpression);
                }

                @Override
                public void visitCodeReferenceElement(GrCodeReferenceElement refElement) {
                  if (processRef(refElement)) return;
                  super.visitCodeReferenceElement(refElement);
                }

                private boolean processRef(
                    @NotNull GrReferenceElement<? extends GroovyPsiElement> refElement) {
                  final PsiElement qualifier = refElement.getQualifier();
                  if (qualifier != null) {
                    final Boolean preserveQualifier =
                        qualifier.getCopyableUserData(PRESERVE_QUALIFIER);
                    if (preserveQualifier != null && !preserveQualifier) {
                      refElement.setQualifier(null);
                      return true;
                    }
                  }
                  return false;
                }
              });
      listenerManager.fireMemberMoved(mySourceClass, movedMember);
    }
  }