@Override
  public @NotNull OperationStatus ensureFilesWritable(@NotNull Collection<? extends VirtualFile> originalFiles) {
    if (originalFiles.isEmpty()) {
      return new OperationStatusImpl(VirtualFile.EMPTY_ARRAY);
    }

    checkThreading();

    Set<VirtualFile> realFiles = new HashSet<>(originalFiles.size());
    for (@Nullable VirtualFile file : originalFiles) {
      file = ObjectUtils.doIfNotNull(file, VirtualFileUtil::originalFileOrSelf);
      if (file instanceof VirtualFileWindow) {
        file = ((VirtualFileWindow)file).getDelegate();
      }
      if (file instanceof BackedVirtualFile) {
        file = ((BackedVirtualFile)file).getOriginFile();
      }
      if (file != null) {
        realFiles.add(file);
      }
    }

    try (AccessToken ignore = SlowOperations.knownIssue("EA-1051315, IJPL-149483")) {
      Collection<? extends VirtualFile> files = new ArrayList<>(realFiles);
      OperationStatusImpl status = myProject.isDefault() ? null : WritingAccessProvider.EP.computeSafeIfAny(myProject, provider -> {
        Collection<VirtualFile> denied = ContainerUtil.filter(files, virtualFile -> !provider.isPotentiallyWritable(virtualFile));
        if (denied.isEmpty()) {
          denied = provider.requestWriting(files);
        }
        return denied.isEmpty() ? null : new OperationStatusImpl(
          VfsUtilCore.toVirtualFileArray(denied),
          provider.getReadOnlyMessage(),
          provider.getHyperlinkListener());
      });
      if (status != null) {
        return status;
      }
      return ensureFilesWritable(originalFiles, files);
    }
  }
@Override
  public @NotNull OperationStatus ensureFilesWritable(@NotNull Collection<? extends VirtualFile> originalFiles)