private void loadModules(@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 = !myLoadUnloadedModules ? JpsProjectConfigurationLoading.readNamesOfUnloadedModules(workspaceFile, myComponentLoader) 
                                                         : Collections.emptySet();

    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();
  }
private void loadModules(@Nullable Element componentElement,
                           @Nullable JpsSdkType<?> projectSdkType,
                           @NotNull Path workspaceFile,
                           @NotNull Executor executor)