private void scanModuleInfoFiles() {
    final List<DetectedSourceRoot> allRoots = super.getSourceRootsToScan();
    final List<JavaModuleSourceRoot> moduleInfoRoots = StreamEx
      .of(allRoots)
      .select(JavaModuleSourceRoot.class)
      .filter(JavaModuleSourceRoot::isWithModuleInfoFile)
      .filter(root -> !isIgnoredName(root.getDirectory()))
      .toList();
    if (moduleInfoRoots.isEmpty()) {
      return;
    }
    myProgress.setIndeterminate(true);
    myProgress.pushState();
    try {
      Map<String, ModuleInfo> moduleInfos = new HashMap<>();
      for (JavaModuleSourceRoot moduleInfoRoot : moduleInfoRoots) {
        final File sourceRoot = moduleInfoRoot.getDirectory();
        myProgress.setText(JavaUiBundle.message("module.insight.scan.progress.text.scanning", sourceRoot.getPath()));
        final ModuleInfo moduleInfo = scanModuleInfoFile(sourceRoot);
        if (moduleInfo != null) {
          moduleInfo.descriptor = createModuleDescriptor(moduleInfo.directory, Collections.singletonList(moduleInfoRoot));
          moduleInfos.put(moduleInfo.name, moduleInfo);
          addExportedPackages(sourceRoot, moduleInfo.exportsPackages);
        }
      }
      myProgress.setText(JavaUiBundle.message("module.insight.scan.progress.text.building.modules.layout"));
      for (ModuleInfo moduleInfo : moduleInfos.values()) {
        for (String requiresModule : moduleInfo.requiresModules) {
          ModuleInfo requiredModuleInfo = moduleInfos.get(requiresModule);
          if (requiredModuleInfo != null) {
            moduleInfo.descriptor.addDependencyOn(requiredModuleInfo.descriptor);
          }
        }
      }

      addModules(ContainerUtil.map(moduleInfos.values(), info -> info.descriptor));
    }
    catch (ProcessCanceledException ignored) { }
    finally {
      myProgress.popState();
    }
  }
private void scanModuleInfoFiles()