inplace refactoring: if test on invalid identifier, don't get into infinite recursion

This commit is contained in:
Anna.Kozlova
2016-07-18 19:01:02 +02:00
parent 5a456afef9
commit d7948e9d2e
@@ -193,6 +193,9 @@ public class VariableInplaceRenamer extends InplaceRefactoring {
if (variable != null) {
final int offset = variable.getTextOffset();
restoreCaretOffset(offset);
if (ApplicationManager.getApplication().isUnitTestMode()) {
return;
}
JBPopupFactory.getInstance()
.createConfirmation("Inserted identifier is not valid", "Continue editing", "Cancel",
() -> createInplaceRenamerToRestart(variable, myEditor, newName).performInplaceRefactoring(nameSuggestions), 0).showInBestPositionFor(myEditor);