private static void collectFiles(@NotNull Library library,
                                   @Nullable MavenCoordinates coordinates,
                                   @NotNull Map<String, String> jarLibrariesIndex) {
    ProgressManager.checkCanceled();

    VirtualFile[] libraryFiles = library.getFiles(OrderRootType.CLASSES);
    if (coordinates == null || libraryFiles.length > 1) {
      JarFileSystem jarFileSystem = JarFileSystem.getInstance();

      for (VirtualFile libraryFile : libraryFiles) {
        if (libraryFile.getFileSystem() != jarFileSystem) continue;

        ProgressManager.checkCanceled();

        String nameWithoutExtension = libraryFile.getNameWithoutExtension();

        // Drop prefix of Bazel processed libraries IDEA-324807
        nameWithoutExtension = intern(sanitizeLibraryName(nameWithoutExtension));

        jarLibrariesIndex.put(nameWithoutExtension, nameWithoutExtension);

        String[] nameParts = nameWithoutExtension.split("-");
        StringBuilder nameBuilder = new StringBuilder();

        for (int i = 0; i < nameParts.length; i++) {
          String part = nameParts[i];
          if (!part.isEmpty() && isDecimalDigit(part.charAt(0))) {
            break;
          }

          if (i > 0) {
            nameBuilder.append("-");
          }
          nameBuilder.append(part);
        }

        String indexNamePart = nameBuilder.toString();
        if (!indexNamePart.equals(nameWithoutExtension)) {
          jarLibrariesIndex.put(indexNamePart, intern(nameWithoutExtension));
        }
      }
    }
  }
private static void collectFiles(@NotNull Library library,
                                   @Nullable MavenCoordinates coordinates,
                                   @NotNull Map<String, String> jarLibrariesIndex)