private boolean tryIndexWithoutContent(@NotNull ID<?, ?> indexId,
                                         @NotNull VirtualFile file,
                                         int fileId,
                                         @NotNull FileContent fileContent,
                                         boolean onlyContentChanged) {
    if (needsFileContentLoading(indexId)) {
      return false;
    }
    else if (!onlyContentChanged || indexId == FileTypeIndex.NAME){
      // Mostly to preserve old behavior and to please the test com.intellij.util.indexing.RequestedToRebuildIndexTest. Rationale:
      //   1. Don't update content-independent indexes if only content has changed - indexes didn't change.
      //   2. FileTypeIndex actually depends on content, but pretends to be content-independent. Update it as well.
      // The test fails because scheduleFileForIndexing is invoked twice from ChangedFilesCollector.processFilesToUpdateInReadAction for
      //   files in state CONTENT_CHANGED+ADDED (once with onlyContentChanged=true, and then with onlyContentChanged=false)
      return updateSingleIndex(indexId, file, fileId, fileContent);
    } else {
      return true; // no update needed
    }
  }
private boolean tryIndexWithoutContent(@NotNull ID<?, ?> indexId,
                                         @NotNull VirtualFile file,
                                         int fileId,
                                         @NotNull FileContent fileContent,
                                         boolean onlyContentChanged)