mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-80163 introduce constant in another class: do not dispose range markers too aggressive
This commit is contained in:
+9
@@ -175,6 +175,7 @@ public class InplaceIntroduceConstantPopup extends AbstractInplaceIntroduceField
|
||||
protected boolean performRefactoring() {
|
||||
JavaRefactoringSettings.getInstance().INTRODUCE_CONSTANT_MOVE_TO_ANOTHER_CLASS = myMoveToAnotherClassCb.isSelected();
|
||||
if (myMoveToAnotherClassCb.isSelected()) {
|
||||
myEditor.putUserData(INTRODUCE_RESTART, true);
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -190,7 +191,15 @@ public class InplaceIntroduceConstantPopup extends AbstractInplaceIntroduceField
|
||||
}
|
||||
}
|
||||
finally {
|
||||
myEditor.putUserData(INTRODUCE_RESTART, false);
|
||||
myEditor.putUserData(ACTIVE_INTRODUCE, null);
|
||||
releaseResources();
|
||||
if (myLocalMarker != null) {
|
||||
myLocalMarker.dispose();
|
||||
}
|
||||
if (myExprMarker != null) {
|
||||
myExprMarker.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
+2
-4
@@ -212,8 +212,7 @@ public abstract class InplaceVariableIntroducer<E extends PsiElement> extends In
|
||||
}
|
||||
|
||||
protected void releaseIfNotRestart() {
|
||||
final Boolean isRestart = myEditor.getUserData(INTRODUCE_RESTART);
|
||||
if (isRestart == null || !isRestart.booleanValue()) {
|
||||
if (!isRestart()) {
|
||||
releaseResources();
|
||||
}
|
||||
}
|
||||
@@ -222,8 +221,7 @@ public abstract class InplaceVariableIntroducer<E extends PsiElement> extends In
|
||||
public void finish(boolean success) {
|
||||
super.finish(success);
|
||||
if (myBalloon != null) {
|
||||
final Boolean isRestart = myEditor.getUserData(INTRODUCE_RESTART);
|
||||
if (isRestart == null || !isRestart.booleanValue()) {
|
||||
if (!isRestart()) {
|
||||
myBalloon.hide();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user