introduce constant: do not delete self if it is still needed
[idea/community.git] / java / java-impl / src / com / intellij / refactoring / introduceField / BaseExpressionToFieldHandler.java
index 62bf188ef677ae71bf915a45bdecfc25e46f7e41..6dcb94df9e927490a31db838f8e73d525777597a 100644 (file)
@@ -147,7 +147,7 @@ public abstract class BaseExpressionToFieldHandler extends IntroduceHandlerBase
 
     PsiElement anchor = getNormalizedAnchor(anchorElement);
 
-    boolean tempDeleteSelf = anchorElement == null;
+    boolean tempDeleteSelf = false;
     if (element.getParent() instanceof PsiExpressionStatement && anchor.equals(anchorElement)) {
       PsiStatement statement = (PsiStatement)element.getParent();
       if (statement.getParent() instanceof PsiCodeBlock) {