introduce refactorings: do not try to rename dependencies after newly introduced variable (EA-26587 - AIOOBE: InplaceIntroduceParameterPopup.getParameter)

This commit is contained in:
anna
2011-04-07 18:19:58 +02:00
parent 8874f2ff81
commit 98a561956c
2 changed files with 10 additions and 1 deletions
@@ -169,6 +169,11 @@ public class VariableInplaceIntroducer extends VariableInplaceRenamer {
return myExprMarker;
}
@Override
protected boolean performAutomaticRename() {
return false;
}
@Override
protected void moveOffsetAfter(boolean success) {
try {
@@ -252,7 +252,7 @@ public class VariableInplaceRenamer {
public void beforeTemplateFinished(final TemplateState templateState, Template template) {
finish();
if (snapshot != null) {
if (snapshot != null && performAutomaticRename()) {
TextResult value = templateState.getVariableValue(PRIMARY_VARIABLE_NAME);
if (value != null) {
myNewName = value.toString();
@@ -329,6 +329,10 @@ public class VariableInplaceRenamer {
return myElementToRename;
}
protected boolean performAutomaticRename() {
return true;
}
protected void moveOffsetAfter(boolean success) {
}