private void fixReferencesToStatic(GroovyPsiElement classMember) throws IncorrectOperationException {
    final StaticReferencesCollector collector = new StaticReferencesCollector(myMembersToMove);
    classMember.accept(collector);
    GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(myProject);

    for (StaticReferenceResult result : collector.results) {
      GrReferenceElement ref = result.reference;
      GrMember namedElement = result.referee;
      PsiClass aClass = result.refereeClass;
      if (namedElement instanceof PsiNamedElement) {
        String name = getNewName((PsiNamedElement)namedElement, result.invokedOnProperty);
        GrReferenceExpression newRef = (GrReferenceExpression)factory.createExpressionFromText("a." + name, null);
        GrExpression qualifier = newRef.getQualifierExpression();
        assert qualifier != null;
        qualifier = (GrExpression)qualifier.replace(factory.createReferenceExpressionFromText(aClass.getQualifiedName()));
        qualifier.putCopyableUserData(PRESERVE_QUALIFIER, ref.isQualified());
        PsiElement replaced = ref.replace(newRef);
        JavaCodeStyleManager.getInstance(myProject).shortenClassReferences(replaced);
      }
    }
  }
private void fixReferencesToStatic(GroovyPsiElement classMember)