com.intellij.codeInsight.FileModificationService



API Populatity

2 Client projects

Project: com.intellij

Related APIs
1 java.util.Collections
Project JetBrains/intellij-community in file ...tion.miscGenerics.RedundantTypeArgsInspection.java (2013-11-05)
@@ -15,6 +15,7 @@
  */
 package com.intellij.codeInspection.miscGenerics;
 
+import com.intellij.codeInsight.FileModificationService;
 import com.intellij.codeInsight.daemon.GroupNames;
 import com.intellij.codeInspection.*;
 import com.intellij.openapi.diagnostic.Logger;
@@ -150,6 +151,7 @@ public class RedundantTypeArgsInspection extends GenericsInspectionToolBase {
     @Override
     public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
       final PsiReferenceParameterList typeArgumentList = (PsiReferenceParameterList)descriptor.getPsiElement();
+      if (!FileModificationService.getInstance().preparePsiElementForWrite(typeArgumentList)) return;
       try {
         final PsiMethodCallExpression expr =
           (PsiMethodCallExpression)JavaPsiFacade.getInstance(project).getElementFactory().createExpressionFromText("foo()", null);
Project JetBrains/intellij-community in file ...x.ReplaceInaccessibleFieldWithGetterSetterFix.java (2013-06-03)
@@ -15,6 +15,7 @@
  */
 package com.intellij.codeInsight.daemon.impl.quickfix;
 
+import com.intellij.codeInsight.FileModificationService;
 import com.intellij.codeInsight.daemon.impl.HighlightInfo;
 import com.intellij.codeInspection.LocalQuickFixAndIntentionActionOnPsiElement;
 import com.intellij.openapi.editor.Editor;
@@ -44,6 +45,7 @@ public class ReplaceInaccessibleFieldWithGetterSetterFix extends LocalQuickFixAn
                      @NotNull PsiElement startElement,
                      @NotNull PsiElement endElement) {
     PsiReferenceExpression place = (PsiReferenceExpression)startElement;
+    if (!FileModificationService.getInstance().preparePsiElementForWrite(place)) return;
     String qualifier = null;
     final PsiExpression qualifierExpression = place.getQualifierExpression();
     if (qualifierExpression != null) {
Project JetBrains/intellij-community in file ....DelegateWithDefaultParamValueIntentionAction.java (2013-06-10)
@@ -15,6 +15,7 @@
  */
 package com.intellij.codeInsight.daemon.impl.quickfix;
 
+import com.intellij.codeInsight.FileModificationService;
 import com.intellij.codeInsight.hint.HintManager;
 import com.intellij.codeInsight.intention.LowPriorityAction;
 import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
@@ -101,6 +102,8 @@ public class DelegateWithDefaultParamValueIntentionAction extends PsiElementBase
       return;
     }
 
+    if (!FileModificationService.getInstance().preparePsiElementForWrite(element)) return;
+    
     Runnable runnable = new Runnable() {
       @Override
       public void run() {