do not rename in the same name

This commit is contained in:
Anna Kozlova
2012-06-04 22:36:19 +04:00
parent fa4c2a6916
commit e3ab850ddc
@@ -491,7 +491,7 @@ public class PsiReferenceExpressionImpl extends PsiReferenceExpressionBase imple
throw new IncorrectOperationException();
}
final String oldRefName = oldIdentifier.getText();
if (PsiKeyword.THIS.equals(oldRefName) || PsiKeyword.SUPER.equals(oldRefName)) return this;
if (PsiKeyword.THIS.equals(oldRefName) || PsiKeyword.SUPER.equals(oldRefName) || Comparing.strEqual(oldRefName, newElementName)) return this;
PsiIdentifier identifier = JavaPsiFacade.getInstance(getProject()).getElementFactory().createIdentifier(newElementName);
oldIdentifier.replace(identifier);
return this;