private void runWithWritingAllowed(@NotNull Runnable runnable) {
    final boolean prev = myWritingAllowed;
    myWritingAllowed = true;
    try {
      runnable.run();
    }
    finally {
      myWritingAllowed = prev;
    }
  }
private void runWithWritingAllowed(@NotNull Runnable runnable)