diff --git a/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java b/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java index e78953acf83c..1cfb37e69c6c 100644 --- a/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java +++ b/java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java @@ -579,12 +579,7 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase impleme callback.pass(null); } else { - new OccurrencesChooser(editor) { - @Override - protected TextRange getOccurrenceRange(PsiExpression occurrence) { - return occurrence.getTextRange(); - } - }.showChooser(callback, occurrencesMap); + new OccurrencesChooser(editor).showChooser(callback, occurrencesMap); } return wasSucceed[0]; } diff --git a/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/OccurrencesChooser.java b/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/OccurrencesChooser.java index 58d848f24320..7304b00cae85 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/OccurrencesChooser.java +++ b/platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/OccurrencesChooser.java @@ -25,6 +25,7 @@ import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.ui.popup.LightweightWindowEvent; import com.intellij.openapi.util.Pass; import com.intellij.openapi.util.TextRange; +import com.intellij.psi.PsiElement; import com.intellij.ui.components.JBList; import javax.swing.*; @@ -39,7 +40,7 @@ import java.util.List; * User: anna * Date: 10/14/10 */ -public abstract class OccurrencesChooser { +public class OccurrencesChooser { public static enum ReplaceChoice { NO("Replace this occurrence only"), NO_WRITE("Replace all occurrences but write"), ALL("Replace all {0} occurrences"); @@ -141,7 +142,9 @@ public abstract class OccurrencesChooser { .createPopup().showInBestPositionFor(myEditor); } - protected abstract TextRange getOccurrenceRange(T occurrence); + protected TextRange getOccurrenceRange(T occurrence) { + return occurrence.getTextRange(); + } private void dropHighlighters() { for (RangeHighlighter highlight : myRangeHighlighters) {