com.intellij.codeInsight.CodeInsightUtilBase



API Populatity

3 Client projects

Project: com.intellij

Project JetBrains/intellij-community in file ...daemon.impl.analysis.AnnotationsHighlightUtil.java (2011-02-22)
@@ -16,6 +16,7 @@
 package com.intellij.codeInsight.daemon.impl.analysis;
 
 import com.intellij.codeInsight.AnnotationUtil;
+import com.intellij.codeInsight.CodeInsightUtilBase;
 import com.intellij.codeInsight.daemon.JavaErrorMessages;
 import com.intellij.codeInsight.daemon.impl.HighlightInfo;
 import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
@@ -480,6 +481,7 @@ public class AnnotationsHighlightUtil {
 
     @Override
     public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
+      if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
       myAnnotation.delete();
     }
 
Project JetBrains/intellij-community in file ...Inspection.ExplicitTypeCanBeDiamondInspection.java (2011-02-22)
@@ -15,6 +15,7 @@
  */
 package com.intellij.codeInspection;
 
+import com.intellij.codeInsight.CodeInsightUtilBase;
 import com.intellij.codeInsight.daemon.GroupNames;
 import com.intellij.codeInsight.intention.HighPriorityAction;
 import com.intellij.openapi.project.Project;
@@ -124,6 +125,7 @@ public class ExplicitTypeCanBeDiamondInspection extends BaseJavaLocalInspectionT
     public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
       final PsiElement psiElement = descriptor.getPsiElement();
       if (psiElement instanceof PsiReferenceParameterList) {
+        if (!CodeInsightUtilBase.prepareFileForWrite(psiElement.getContainingFile())) return;
         final PsiTypeElement[] parameterElements = ((PsiReferenceParameterList)psiElement).getTypeParameterElements();
         psiElement.deleteChildRange(parameterElements[0], parameterElements[parameterElements.length - 1]);
       }
Project JetBrains/intellij-community in file ...pl.quickfix.ReplaceAddAllArrayToCollectionFix.java (2008-03-27)
@@ -4,6 +4,7 @@
  */
 package com.intellij.codeInsight.daemon.impl.quickfix;
 
+import com.intellij.codeInsight.CodeInsightUtilBase;
 import com.intellij.codeInsight.intention.IntentionAction;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.module.Module;
@@ -75,6 +76,7 @@ public class ReplaceAddAllArrayToCollectionFix implements IntentionAction {
   }
 
   public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
+    if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
     final PsiElementFactory elementFactory = JavaPsiFacade.getInstance(project).getElementFactory();
     final PsiExpression toReplace = elementFactory.createExpressionFromText(getCollectionsMethodCall(), myMethodCall);
     JavaCodeStyleManager.getInstance(project).shortenClassReferences(myMethodCall.replace(toReplace));