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 d4d77692d8ce..db33c980ab61 100644 --- a/java/testFramework/src/com/intellij/codeInsight/daemon/quickFix/LightQuickFixTestCase.java +++ b/java/testFramework/src/com/intellij/codeInsight/daemon/quickFix/LightQuickFixTestCase.java @@ -29,6 +29,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; +import com.intellij.openapi.vcs.readOnlyHandler.ReadonlyStatusHandlerImpl; import com.intellij.openapi.vfs.CharsetToolkit; import com.intellij.openapi.vfs.ReadonlyStatusHandler; import com.intellij.psi.PsiFile; @@ -196,7 +197,7 @@ public abstract class LightQuickFixTestCase extends LightDaemonAnalyzerTestCase throw new UncheckedIOException(e); } }); - ReadonlyStatusHandler handler = ReadonlyStatusHandler.getInstance(file.getProject()); + ReadonlyStatusHandlerImpl handler = (ReadonlyStatusHandlerImpl)ReadonlyStatusHandler.getInstance(file.getProject()); handler.setClearReadOnlyInTests(true); try { ShowIntentionActionsHandler.chooseActionAndInvoke(file, getEditor(), action, action.getText()); diff --git a/platform/platform-api/src/com/intellij/openapi/vfs/ReadonlyStatusHandler.java b/platform/platform-api/src/com/intellij/openapi/vfs/ReadonlyStatusHandler.java index 307716b28b38..6876b48b4fcb 100644 --- a/platform/platform-api/src/com/intellij/openapi/vfs/ReadonlyStatusHandler.java +++ b/platform/platform-api/src/com/intellij/openapi/vfs/ReadonlyStatusHandler.java @@ -21,7 +21,6 @@ import com.intellij.openapi.project.Project; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.TestOnly; import java.util.Collection; @@ -68,14 +67,4 @@ public abstract class ReadonlyStatusHandler { public static ReadonlyStatusHandler getInstance(@NotNull Project project) { return ServiceManager.getService(project, ReadonlyStatusHandler.class); } - - /** - * Normally when file is read-only and ensureFilesWritable is called, a dialog box appears which allows user to decide - * whether to clear read-only flag or not. This method allows to control what will happen in unit-test mode. - * - * @param clearReadOnlyInTests if true, ensureFilesWritable will try to clear read-only status from passed files. - * Otherwise, read-only status is not modified (as if user refused to modify it). - */ - @TestOnly - public abstract void setClearReadOnlyInTests(boolean clearReadOnlyInTests); } diff --git a/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/ReadonlyStatusHandlerImpl.java b/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/ReadonlyStatusHandlerImpl.java index 4630d76263bc..de2fa092a533 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/ReadonlyStatusHandlerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/ReadonlyStatusHandlerImpl.java @@ -158,7 +158,13 @@ public class ReadonlyStatusHandlerImpl extends ReadonlyStatusHandler implements } } - @Override + /** + * Normally when file is read-only and ensureFilesWritable is called, a dialog box appears which allows user to decide + * whether to clear read-only flag or not. This method allows to control what will happen in unit-test mode. + * + * @param clearReadOnlyInTests if true, ensureFilesWritable will try to clear read-only status from passed files. + * Otherwise, read-only status is not modified (as if user refused to modify it). + */ @TestOnly public void setClearReadOnlyInTests(boolean clearReadOnlyInTests) { assert ApplicationManager.getApplication().isUnitTestMode();