static @NotNull Libraries fillLibraries(OrderEnumerator orderEnumerator, boolean collectFiles) {
    Set<String> allMavenCoords = new HashSet<>();
    Map<String, String> jarLibrariesIndex = new HashMap<>();

    orderEnumerator.recursively()
      .forEachLibrary(library -> {
        MavenCoordinates coordinates = getMavenCoordinates(library);
        if (coordinates != null
            && allMavenCoords.add(intern(coordinates.getGroupId() + ":" + coordinates.getArtifactId()))) {
          ProgressManager.checkCanceled();
        }

        if (collectFiles && library instanceof LibraryEx) {
          LibraryProperties<?> libraryProperties = ((LibraryEx)library).getProperties();
          if (libraryProperties == null || libraryProperties instanceof RepositoryLibraryProperties) {
            collectFiles(library, coordinates, jarLibrariesIndex);
          }
        }

        return true;
      });

    return new Libraries(Set.copyOf(allMavenCoords), Map.copyOf(jarLibrariesIndex));
  }
static @NotNull Libraries fillLibraries(OrderEnumerator orderEnumerator, boolean collectFiles)