private @NotNull Collection<ThrowableRunnable<?>> initAssociatedDataForExtensions(@NotNull OrphanDirtyFilesQueue orphanDirtyFilesQueue) {
    Activity activity = StartUpMeasurer.startActivity("file index extensions iteration");
    Iterator<FileBasedIndexExtension<?, ?>> extensions = FileBasedIndexExtension.EXTENSION_POINT_NAME.getIterable().iterator();
    List<ThrowableRunnable<?>> tasks = new ArrayList<>(FileBasedIndexExtension.EXTENSION_POINT_NAME.getPoint().size());

    IntSet allDirtyFiles = new IntOpenHashSet(orphanDirtyFilesQueue.getFileIds());
    if (StaleIndexesChecker.shouldCheckStaleIndexesOnStartup()) {
      readAllProjectDirtyFilesQueues(allDirtyFiles);
    }
    // todo: init contentless indices first ?
    while (extensions.hasNext()) {
      FileBasedIndexExtension<?, ?> extension = extensions.next();
      RebuildStatus.registerIndex(extension.getName());

      tasks.add(() -> {
        if (IOUtil.isSharedCachesEnabled()) {
          IOUtil.OVERRIDE_BYTE_BUFFERS_USE_NATIVE_BYTE_ORDER_PROP.set(false);
        }
        try {
          myStaleIds.addAll(FileBasedIndexImpl.registerIndexer(extension,
                                                               myState,
                                                               myRegistrationResultSink,
                                                               allDirtyFiles));

          // FileBasedIndexImpl.registerIndexer may throw, then the line below will not be executed
          myRegisteredIndexes.registerIndexExtension(extension);
        }
        catch (IOException | AlreadyDisposedException | ProcessCanceledException e) {
          LOG.warnWithDebug("Could not register indexing extension: " + extension + ". reason: " + e, e);
          ID.unloadId(extension.getName());
          throw e;
        }
        catch (Throwable t) {
          LOG.warnWithDebug("Could not register indexing extension: " + extension + ". reason: " + t, t);
          ID.unloadId(extension.getName());
          handleComponentError(t, extension.getClass().getName(), null);
        }
        finally {
          IOUtil.OVERRIDE_BYTE_BUFFERS_USE_NATIVE_BYTE_ORDER_PROP.remove();
        }
      });
    }

    myRegisteredIndexes.extensionsDataWasLoaded();
    activity.end();

    return tasks;
  }
private @NotNull Collection<ThrowableRunnable<?>> initAssociatedDataForExtensions(@NotNull OrphanDirtyFilesQueue orphanDirtyFilesQueue)