void () { myProgress.setIndeterminate(true); myProgress.pushState(); try { try { for (File root : myEntryPointRoots) { myProgress.setText(JavaUiBundle.message("progress.text.scanning.for.libraries", root.getPath())); scanRootForLibraries(root); } } catch (ProcessCanceledException ignored) { } myProgress.setText(JavaUiBundle.message("progress.text.building.initial.libraries.layout")); final List<LibraryDescriptor> libraries = buildInitialLibrariesLayout(myJarToPackagesMap.keySet()); // correct library names so that there are no duplicates final Set<String> libNames = new HashSet<>(myExistingProjectLibraryNames); for (LibraryDescriptor library : libraries) { final Collection<File> libJars = library.getJars(); final String newName = suggestUniqueName(libNames, libJars.size() == 1 ? FileUtilRt .getNameWithoutExtension(libJars.iterator().next().getName()) : library.getName()); library.setName(newName); libNames.add(newName); } myLibraries = libraries; } finally { myProgress.popState(); } }