restore local variable during inplace introduce (EA-33085 - NPE: IntroduceFieldDialog...
authoranna <Anna.Kozlova@jetbrains.com>
Tue, 17 Jan 2012 18:01:35 +0000 (19:01 +0100)
committeranna <Anna.Kozlova@jetbrains.com>
Tue, 17 Jan 2012 18:14:55 +0000 (19:14 +0100)
platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/AbstractInplaceIntroducer.java

index 085d3e9d7cbcaa50ac94d28e483e230dfa677620..fe3dcfdfb65211c31545b0fdcc045410c176dc02 100644 (file)
@@ -63,7 +63,7 @@ import java.util.List;
  */
 public abstract class AbstractInplaceIntroducer<V extends PsiNameIdentifierOwner, E extends PsiElement> extends
                                                                                                         InplaceVariableIntroducer<E> {
-  protected final V myLocalVariable;
+  protected V myLocalVariable;
   protected RangeMarker myLocalMarker;
 
   protected final String myExprText;
@@ -433,6 +433,7 @@ public abstract class AbstractInplaceIntroducer<V extends PsiNameIdentifierOwner
 
           final V localVariable = getLocalVariable();
           if (localVariable != null && localVariable.isPhysical()) {
+            myLocalVariable = localVariable;
             final PsiElement nameIdentifier = localVariable.getNameIdentifier();
             if (nameIdentifier != null) {
               myLocalMarker = createMarker(nameIdentifier);