void (@NotNull final Project project, @NotNull final Map<Module, Set<String>> module2NatureNames) { if (module2NatureNames.size() == 0) { return; } StartupManager.getInstance(project).runAfterOpened(() -> { DumbService.getInstance(project).smartInvokeLater(() -> { for (EclipseNatureImporter importer : EclipseNatureImporter.EP_NAME.getExtensions()) { final String importerNatureName = importer.getNatureName(); final List<Module> modulesToImport = new ArrayList<>(); for (Map.Entry<Module, Set<String>> entry : module2NatureNames.entrySet()) { final Module module = entry.getKey(); final Set<String> natureNames = entry.getValue(); if (natureNames.contains(importerNatureName)) { modulesToImport.add(module); } } if (modulesToImport.size() > 0) { importer.doImport(project, modulesToImport); } } }); }); }