void (final @NotNull Collection<? extends DataNode<LibraryData>> toImport, final @Nullable ProjectData projectData, final @NotNull Project project, final @NotNull IdeModifiableModelsProvider modelsProvider) { Map<String, LibraryData> processedLibraries = new HashMap<>(); for (DataNode<LibraryData> dataNode: toImport) { LibraryData libraryData = dataNode.getData(); String libraryName = libraryData.getInternalName(); LibraryData importedLibrary = processedLibraries.putIfAbsent(libraryName, libraryData); if (importedLibrary == null) { importLibrary(libraryData, modelsProvider); } else { LOG.warn("Multiple project level libraries found with the same name '" + libraryName + "'"); if (LOG.isDebugEnabled()) { LOG.debug("Chosen library:" + importedLibrary.getPaths(LibraryPathType.BINARY)); LOG.debug("Ignored library:" + libraryData.getPaths(LibraryPathType.BINARY)); } } } }