public Collection<String> call() throws GitAPIException {checkCallable();try (SubmoduleWalk generator = SubmoduleWalk.forIndex(repo)) {if (!paths.isEmpty())generator.setFilter(PathFilterGroup.createFromStrings(paths));StoredConfig config = repo.getConfig();List<String> initialized = new ArrayList<>();while (generator.next()) {if (generator.getConfigUrl() != null)continue;String path = generator.getPath();String name = generator.getModuleName();String url = generator.getRemoteUrl();String update = generator.getModulesUpdate();if (url != null)config.setString(ConfigConstants.CONFIG_SUBMODULE_SECTION,name, ConfigConstants.CONFIG_KEY_URL, url);if (update != null)config.setString(ConfigConstants.CONFIG_SUBMODULE_SECTION,name, ConfigConstants.CONFIG_KEY_UPDATE, update);if (url != null || update != null)initialized.add(path);}if (!initialized.isEmpty())config.save();return initialized;} catch (IOException | ConfigInvalidException e) {throw new JGitInternalException(e.getMessage(), e);}}

public override ICollection<string> Call(){CheckCallable();try{SubmoduleWalk generator = SubmoduleWalk.ForIndex(repo);if (!paths.IsEmpty()){generator.SetFilter(PathFilterGroup.CreateFromStrings(paths));}StoredConfig config = repo.GetConfig();IList<string> initialized = new AList<string>();while (generator.Next()){if (generator.GetConfigUrl() != null){continue;}string path = generator.GetPath();string url = generator.GetRemoteUrl();string update = generator.GetModulesUpdate();if (url != null){config.SetString(ConfigConstants.CONFIG_SUBMODULE_SECTION, path, ConfigConstants.CONFIG_KEY_URL, url);}if (update != null){config.SetString(ConfigConstants.CONFIG_SUBMODULE_SECTION, path, ConfigConstants.CONFIG_KEY_UPDATE, update);}if (url != null || update != null){initialized.AddItem(path);}}if (!initialized.IsEmpty()){config.Save();}return initialized;}catch (IOException e){throw new JGitInternalException(e.Message, e);}catch (ConfigInvalidException e){throw new JGitInternalException(e.Message, e);}}
