From a9b87de97090b4f7d25ace0525edc1268cfa737f Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 8 Aug 2016 18:50:01 -0700 Subject: [PATCH] RepoCommand: Avoid group lists shadowing groups strings Reported-by: David Pursehouse Change-Id: I9e9b021d335bda4d58b6bcc30f59b81ac5b37724 Signed-off-by: Jonathan Nieder --- .../src/org/eclipse/jgit/gitrepo/RepoCommand.java | 6 +++--- .../src/org/eclipse/jgit/gitrepo/RepoProject.java | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java index ca976a1a3..9b7f094d0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java @@ -107,7 +107,7 @@ public class RepoCommand extends GitCommand { private String path; private String uri; - private String groups; + private String groupsParam; private String branch; private String targetBranch = Constants.HEAD; private boolean recordRemoteBranch = false; @@ -286,7 +286,7 @@ public RepoCommand setURI(String uri) { * @return this command */ public RepoCommand setGroups(String groups) { - this.groups = groups; + this.groupsParam = groups; return this; } @@ -478,7 +478,7 @@ public RevCommit call() throws GitAPIException { git = new Git(repo); ManifestParser parser = new ManifestParser( - includedReader, path, branch, uri, groups, repo); + includedReader, path, branch, uri, groupsParam, repo); try { parser.read(inputStream); for (RepoProject proj : parser.getFilteredProjects()) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java index d29f6c01e..ff4a3ed1c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java @@ -167,14 +167,14 @@ public RepoProject(String name, String path, String revision, * a SHA-1 or branch name or tag name * @param remote * name of the remote definition - * @param groups + * @param groupsParam * comma separated group list */ public RepoProject(String name, String path, String revision, - String remote, String groups) { + String remote, String groupsParam) { this(name, path, revision, remote, new HashSet(), null); - if (groups != null && groups.length() > 0) - this.setGroups(groups); + if (groupsParam != null && groupsParam.length() > 0) + this.setGroups(groupsParam); } /** @@ -191,14 +191,14 @@ public RepoProject setUrl(String url) { /** * Set the url of the sub repo. * - * @param groups + * @param groupsParam * comma separated group list * @return this for chaining. * @since 4.4 */ - public RepoProject setGroups(String groups) { + public RepoProject setGroups(String groupsParam) { this.groups.clear(); - this.groups.addAll(Arrays.asList(groups.split(","))); //$NON-NLS-1$ + this.groups.addAll(Arrays.asList(groupsParam.split(","))); //$NON-NLS-1$ return this; }