EA-70357 AddMethodQualifierFix checks allowage of file modification

This commit is contained in:
Dmitry Batkovich
2015-07-02 21:15:00 +03:00
parent 92a9476e99
commit 7f5f30d8bd
@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.FileModificationService;
import com.intellij.codeInsight.daemon.QuickFixBundle;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.openapi.application.ApplicationManager;
@@ -112,6 +113,9 @@ public class AddMethodQualifierFix implements IntentionAction {
@Override
public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
if (!FileModificationService.getInstance().preparePsiElementsForWrite(file)) {
return;
}
if (myCandidates.size() == 1 || UNIT_TEST_MODE) {
qualify(myCandidates.get(0), editor);
}