cannot modify read only file
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 12 May 2011 09:29:09 +0000 (13:29 +0400)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 12 May 2011 09:29:09 +0000 (13:29 +0400)
java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocReferenceInspection.java

index 4cf4d7f9bc6ed1fe48c3e2f864523effb184f6c0..cc67b4e8826fb32afb97691690394dc24cc1c7c9 100644 (file)
@@ -16,6 +16,7 @@
 package com.intellij.codeInspection.javaDoc;
 
 import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.CodeInsightUtilBase;
 import com.intellij.codeInsight.daemon.QuickFixBundle;
 import com.intellij.codeInsight.daemon.impl.quickfix.ImportClassFix;
 import com.intellij.codeInsight.lookup.LookupElement;
@@ -327,6 +328,7 @@ public class JavaDocReferenceInspection extends BaseLocalInspectionTool {
     public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
       final PsiDocTag myTag = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), PsiDocTag.class);
       if (myTag == null) return;
+      if (!CodeInsightUtilBase.preparePsiElementForWrite(myTag)) return;
       myTag.delete();
     }
   }