PsiExpression (@NotNull PsiExpression initializer) { if (myField == null) return initializer; final PsiReferenceExpression[] replacedRef = {null}; initializer.accept(new JavaRecursiveElementVisitor() { @Override public void visitReferenceExpression(@NotNull PsiReferenceExpression expression) { final PsiExpression qualifierExpression = expression.getQualifierExpression(); if (qualifierExpression != null) { qualifierExpression.accept(this); } else { final PsiElement result = expression.resolve(); if (expression.getManager().areElementsEquivalent(result, myField)) { try { replacedRef[0] = RefactoringChangeUtil.qualifyReference(expression, myField, myQualifyingClass); } catch (IncorrectOperationException e) { LOG.error(e); } } } } }); if (!initializer.isValid()) return replacedRef[0]; return initializer; }