List<ModuleInfo> () { List<ModuleInfo> moduleInfo = new ArrayList<>(); for (ModuleNode moduleNode : myModuleNodes) { if (moduleNode.getDescriptor() != null) { LOG.info("Module descriptor already exists in " + moduleNode); continue; } for (String packageName : moduleNode.getDeclaredPackages()) { if (myUsedExternallyPackages.contains(packageName)) { moduleNode.getExports().add(packageName); } } PsiDirectory rootDir = moduleNode.getRootDir(); if (rootDir != null) { List<String> dependencies = StreamEx.of(moduleNode.getSortedDependencies()) .map(ModuleNode::getName) .filter(name -> !JAVA_BASE.equals(name)) .toList(); List<String> exports = moduleNode.getSortedExports(); moduleInfo.add(new ModuleInfo(rootDir, moduleNode.getName(), dependencies, exports)); } else { LOG.info("Skipped module " + moduleNode + " because it doesn't have production source root"); } myProgressTracker.increment(); } return moduleInfo; }