boolean (VirtualFile vFile, Project project, Runnable action) { boolean writable; ReadonlyStatusHandlerImpl handler = (ReadonlyStatusHandlerImpl)ReadonlyStatusHandler.getInstance(project); setReadOnly(vFile, true); handler.setClearReadOnlyInTests(true); try { action.run(); } finally { writable = vFile.isWritable(); handler.setClearReadOnlyInTests(false); setReadOnly(vFile, false); } return writable; }