int (@NotNull Project project, @NotNull Map<Module, List<File>> classFiles) { ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); indicator.setIndeterminate(true); indicator.setText(JavaRefactoringBundle.message("generate.module.descriptors.scanning.message")); Module[] modules = StreamEx.of(ModuleManager.getInstance(project).getModules()) .filter(module -> mayContainModuleInfo(module)) .toArray(Module.EMPTY_ARRAY); if (modules.length == 0) { CommonRefactoringUtil.showErrorHint( project, null, JavaRefactoringBundle.message("generate.module.descriptors.no.suitable.modules.message"), getTitle(), null); return 0; } int totalFiles = 0; for (Module module : modules) { List<File> moduleClasses = new ArrayList<>(); classFiles.put(module, moduleClasses); String production = CompilerPaths.getModuleOutputPath(module, false); File productionRoot = production != null ? new File(production) : null; if (productionRoot != null) { collectClassFiles(productionRoot, moduleClasses); } totalFiles += moduleClasses.size(); } if (totalFiles == 0) { CommonRefactoringUtil.showErrorHint( project, null, JavaRefactoringBundle.message("generate.module.descriptors.build.required.message"), getTitle(), null); } return totalFiles; }