From ddb0d197eea577ef1e558a8d99032c674bcb6c17 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Mon, 19 Sep 2016 09:32:33 +0700 Subject: [PATCH] adds more clarifying comments to setReadOnlyAttribute call --- .../codeInsight/daemon/quickFix/LightQuickFixTestCase.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/testFramework/src/com/intellij/codeInsight/daemon/quickFix/LightQuickFixTestCase.java b/java/testFramework/src/com/intellij/codeInsight/daemon/quickFix/LightQuickFixTestCase.java index 4c25eb27de4f..39221ecff1cf 100644 --- a/java/testFramework/src/com/intellij/codeInsight/daemon/quickFix/LightQuickFixTestCase.java +++ b/java/testFramework/src/com/intellij/codeInsight/daemon/quickFix/LightQuickFixTestCase.java @@ -186,7 +186,9 @@ public abstract class LightQuickFixTestCase extends LightDaemonAnalyzerTestCase PsiFile file = getFile(); WriteAction.run(() -> { try { - // Test that action will automatically clear the read-only attribute if modification is necessary + // Test that action will automatically clear the read-only attribute if modification is necessary. + // If your test fails due to this, make sure that your quick-fix/intention has the following line: + // if (!FileModificationService.getInstance().prepareFileForWrite(file)) return; ReadOnlyAttributeUtil.setReadOnlyAttribute(file.getVirtualFile(), true); } catch (IOException e) {