void (@Nullable Element componentElement, @Nullable JpsSdkType<?> projectSdkType, @NotNull Path workspaceFile, @NotNull Executor executor) { Runnable timingLog = TimingLog.startActivity("loading modules"); if (componentElement == null) { return; } Set<String> unloadedModules = new HashSet<>(); if (!myLoadUnloadedModules && workspaceFile.toFile().exists()) { Element unloadedModulesList = JDomSerializationUtil.findComponent(loadRootElement(workspaceFile), "UnloadedModulesList"); for (Element element : JDOMUtil.getChildren(unloadedModulesList, "module")) { unloadedModules.add(element.getAttributeValue("name")); } } final Set<Path> foundFiles = CollectionFactory.createSmallMemoryFootprintSet(); final List<Path> moduleFiles = new ArrayList<>(); for (Element moduleElement : JDOMUtil.getChildren(componentElement.getChild(MODULES_TAG), MODULE_TAG)) { final String path = moduleElement.getAttributeValue(FILE_PATH_ATTRIBUTE); if (path != null) { final Path file = Path.of(path); if (foundFiles.add(file) && !unloadedModules.contains(getModuleName(file))) { moduleFiles.add(file); } } } List<JpsModule> modules = loadModules(moduleFiles, projectSdkType, myPathVariables, myPathMapper, executor); for (JpsModule module : modules) { myProject.addModule(module); } timingLog.run(); }