From 86c6da36f79a8d567b943642945b75c045b0793e Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Tue, 23 May 2017 20:32:43 +0300 Subject: [PATCH] disable fixes in batch mode (IDEA-CR-21292) --- .../refactoring/invertBoolean/InvertBooleanHandler.java | 3 +-- .../dataflow/BooleanVariableAlwaysNegatedInspectionBase.java | 5 +++++ .../NegativelyNamedBooleanVariableInspectionBase.java | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/refactoring/invertBoolean/InvertBooleanHandler.java b/platform/lang-impl/src/com/intellij/refactoring/invertBoolean/InvertBooleanHandler.java index df6e6f231372..688a0e62d292 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/invertBoolean/InvertBooleanHandler.java +++ b/platform/lang-impl/src/com/intellij/refactoring/invertBoolean/InvertBooleanHandler.java @@ -17,7 +17,6 @@ package com.intellij.refactoring.invertBoolean; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.DataContext; -import com.intellij.openapi.application.TransactionGuard; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.ScrollType; @@ -73,7 +72,7 @@ public class InvertBooleanHandler implements RefactoringActionHandler { } PsiElement element = delegate.adjustElement(elements[0], project, null); if (element != null && PsiElementRenameHandler.canRename(project, null, element)) { - TransactionGuard.getInstance().submitTransactionAndWait(() -> new InvertBooleanDialog(element).show()); + new InvertBooleanDialog(element).show(); } } } diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/BooleanVariableAlwaysNegatedInspectionBase.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/BooleanVariableAlwaysNegatedInspectionBase.java index ba7ed0835b35..e11865cefac1 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/BooleanVariableAlwaysNegatedInspectionBase.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/BooleanVariableAlwaysNegatedInspectionBase.java @@ -49,6 +49,11 @@ class BooleanVariableAlwaysNegatedInspectionBase extends BaseInspection { } } + @Override + protected boolean buildQuickFixesOnlyForOnTheFlyErrors() { + return true; + } + @Override public BaseInspectionVisitor buildVisitor() { return new BooleanVariableAlwaysNegatedVisitor(); diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/NegativelyNamedBooleanVariableInspectionBase.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/NegativelyNamedBooleanVariableInspectionBase.java index 8ae75d1fd97e..58e2b95c6b24 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/NegativelyNamedBooleanVariableInspectionBase.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dataflow/NegativelyNamedBooleanVariableInspectionBase.java @@ -47,6 +47,11 @@ public class NegativelyNamedBooleanVariableInspectionBase extends BaseInspection return InspectionGadgetsBundle.message("negatively.named.boolean.variable.problem.descriptor"); } + @Override + protected boolean buildQuickFixesOnlyForOnTheFlyErrors() { + return true; + } + @Override public BaseInspectionVisitor buildVisitor() { return new NegativelyNamedBooleanVariableVisitor();