@Override public void visitReferenceExpression(@NotNull PsiReferenceExpression expression) {
        try {
          final PsiExpression qualifier = expression.getQualifierExpression();
          final PsiElement resolved = expression.resolve();
          if (ExpressionUtils.isReferenceTo(qualifier, myTargetVariable)) {
            if (resolved instanceof PsiField) {
              String fieldName = ((PsiField)resolved).getName();
              for (PsiParameter parameter : myMethod.getParameterList().getParameters()) {
                if (Comparing.strEqual(parameter.getName(), fieldName) ||
                    facade.getResolveHelper().resolveReferencedVariable(fieldName, expression) != null) {
                  qualifier.replace(factory.createExpressionFromText("this", null));
                  return;
                }
              }
            }
            if (expression instanceof PsiMethodReferenceExpression) {
              qualifier.replace(factory.createExpressionFromText("this", null));
            }
            else {
              //Target is a field, replace target.m -> m
              qualifier.delete();
            }
            return;
          }
          if (myTargetVariable.equals(resolved)) {
            PsiThisExpression thisExpression = RefactoringChangeUtil.createThisExpression(
              manager, PsiTreeUtil.isAncestor(myMethod, PsiUtil.getContainingClass(expression), true) ? myTargetClass : null);
            replaceMap.put(expression, thisExpression);
            return;
          }
          if (!myMethod.equals(resolved)) {
            PsiClass classReferencedByThis = MoveInstanceMembersUtil.getClassReferencedByThis(expression);
            if (classReferencedByThis != null) {
              final String paramName = getParameterNameToCreate(classReferencedByThis);
              if (paramName != null) {
                PsiReferenceExpression newQualifier = (PsiReferenceExpression)factory.createExpressionFromText(paramName, null);
                expression.setQualifierExpression(newQualifier);
                return;
              }
            }
          }
          super.visitReferenceExpression(expression);
        }
        catch (IncorrectOperationException e) {
          LOG.error(e);
        }
      }
@Override public void visitReferenceExpression(@NotNull PsiReferenceExpression expression)