List<Module> (@NotNull Project project, ModifiableModuleModel model, ModulesProvider modulesProvider) { ModulesProvider updatedModulesProvider; ModifiableModuleModel moduleModel; boolean commitModels; if (model != null) { // from project structure moduleModel = model; updatedModulesProvider = modulesProvider; commitModels = false; } else { moduleModel = ModuleManager.getInstance(project).getModifiableModel(); updatedModulesProvider = new DefaultModulesProvider(project); commitModels = true; } return new ProjectFromSourcesBuilderHelper( project, moduleModel, updatedModulesProvider, commitModels, myUpdaters, getSelectedDescriptors()).commit(); }