<K, V> void registerIndex(@NotNull ID<K, V> indexId,
                            @NotNull UpdatableIndex<K, V, FileContent, ?> index,
                            @NotNull FileBasedIndex.InputFilter inputFilter,
                            int version) {
    assert !myFreezed;

    synchronized (myIndices) {
      myIndexIds.add(indexId);
      myIndexIdToVersionMap.put(indexId, version);

      Collection<FileType> associatedFileTypes = getAssociatedFileTypes(inputFilter);
      if (associatedFileTypes != null) {
        for (FileType fileType : associatedFileTypes) {
          List<ID<?, ?>> ids = myFileType2IndicesWithFileTypeInfoMap.computeIfAbsent(fileType, __ -> new ArrayList<>(5));
          ids.add(indexId);
        }
      }
      else {
        myIndicesWithoutFileTypeInfo.add(indexId);
      }

      Pair<UpdatableIndex<?, ?, FileContent, ?>, FileBasedIndex.InputFilter> old =
        myIndices.put(indexId.getUniqueId(), new Pair<>(index, inputFilter));
      if (old != null) {
        throw new IllegalStateException("Index " + old.first + " already registered for the name '" + indexId + "'");
      }
    }
  }
<K, V> void registerIndex(@NotNull ID<K, V> indexId,
                            @NotNull UpdatableIndex<K, V, FileContent, ?> index,
                            @NotNull FileBasedIndex.InputFilter inputFilter,
                            int version)