make some quick fixes not require write action
authorpeter <peter@jetbrains.com>
Thu, 10 Nov 2016 16:09:33 +0000 (17:09 +0100)
committerpeter <peter@jetbrains.com>
Thu, 10 Nov 2016 16:55:08 +0000 (17:55 +0100)
java/java-analysis-impl/src/com/intellij/codeInspection/nullable/ChangeNullableDefaultsFix.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/EnableOptimizeImportsOnTheFlyFix.java
java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationPresentation.java
java/java-impl/src/com/intellij/codeInspection/util/SpecialAnnotationsUtil.java

index 237f227c4aa3aee648fc986a30374192233c4af9..c3549dffc93bda27047ca081cd7ba3b20247677b 100644 (file)
@@ -49,6 +49,11 @@ class ChangeNullableDefaultsFix implements LocalQuickFix {
     return "Make \"" + (myNotNullName != null ? myNotNullName : myNullableName) + "\" default annotation";
   }
 
+  @Override
+  public boolean startInWriteAction() {
+    return false;
+  }
+
   @Override
   public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
     if (myNotNullName != null) {
index 91e9910e146224c4a65fe68efc0f3790be83777d..f3ac84cf05bb8affd4ae4b478e92e4d593ddcafb 100644 (file)
@@ -55,6 +55,6 @@ public class EnableOptimizeImportsOnTheFlyFix implements IntentionAction, LowPri
 
   @Override
   public boolean startInWriteAction() {
-    return true;
+    return false;
   }
 }
index 1fe7c3b046dbb9aaf37458afd53b82d5f8ee8ada..a654116fb20d7e220450a677474f730251090a0f 100644 (file)
@@ -619,7 +619,7 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta
 
     @Override
     public boolean startInWriteAction() {
-      return true;
+      return false;
     }
   }
 
index ccc0845ec42f66703a1fdde7463b8a0c7e200715..65ab2dd9c422a7a30c96d5f2a1aeb202cd26f5aa 100644 (file)
@@ -29,13 +29,13 @@ import com.intellij.openapi.project.Project;
 import com.intellij.openapi.project.ProjectManager;
 import com.intellij.openapi.ui.Messages;
 import com.intellij.openapi.util.Condition;
-import com.intellij.psi.*;
+import com.intellij.psi.PsiClass;
+import com.intellij.psi.PsiFile;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.ui.*;
 import com.intellij.ui.components.JBList;
 import com.intellij.util.IconUtil;
 import com.intellij.util.IncorrectOperationException;
-import com.intellij.util.containers.Predicate;
 import org.jetbrains.annotations.NotNull;
 
 import javax.swing.*;
@@ -170,7 +170,7 @@ public class SpecialAnnotationsUtil {
 
       @Override
       public boolean startInWriteAction() {
-        return true;
+        return false;
       }
     };
   }