diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java b/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java index d7a768516606..d4802f2310d4 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java @@ -19,8 +19,9 @@ import git4idea.GitBranch; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Collection; +import java.util.Collections; import java.util.HashSet; -import java.util.Set; /** *

@@ -35,13 +36,13 @@ import java.util.Set; */ public final class GitBranchesCollection { - public static final GitBranchesCollection EMPTY = new GitBranchesCollection(null, new HashSet(), new HashSet()); + public static final GitBranchesCollection EMPTY = new GitBranchesCollection(null, Collections.emptyList(), Collections.emptyList()); - private final Set myLocalBranches; - private final Set myRemoteBranches; + private final Collection myLocalBranches; + private final Collection myRemoteBranches; private final GitBranch myCurrentBranch; - public GitBranchesCollection(@Nullable GitBranch currentBranch, @NotNull Set localBranches, @NotNull Set remoteBranches) { + public GitBranchesCollection(@Nullable GitBranch currentBranch, @NotNull Collection localBranches, @NotNull Collection remoteBranches) { myCurrentBranch = currentBranch; myRemoteBranches = remoteBranches; myLocalBranches = localBranches; @@ -58,7 +59,7 @@ public final class GitBranchesCollection { * @return the copy of local branches set. */ @NotNull - public Set getLocalBranches() { + public Collection getLocalBranches() { return new HashSet(myLocalBranches); } @@ -66,7 +67,7 @@ public final class GitBranchesCollection { * @return the copy of remote branches set. */ @NotNull - public Set getRemoteBranches() { + public Collection getRemoteBranches() { return new HashSet(myRemoteBranches); } diff --git a/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java b/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java index 8e9100451e7f..b1fed80b208c 100644 --- a/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java +++ b/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java @@ -117,11 +117,11 @@ public class LowLevelAccessImpl implements LowLevelAccess { final GitRepository repositoryForRoot = GitRepositoryManager.getInstance(myProject).getRepositoryForRoot(myRoot); if (repositoryForRoot != null) { final GitBranchesCollection branches = repositoryForRoot.getBranches(); - final Set localBranches = branches.getLocalBranches(); + final Collection localBranches = branches.getLocalBranches(); for (GitBranch localBranch : localBranches) { refs.addLocal(localBranch.getName()); } - final Set remoteBranches = branches.getRemoteBranches(); + final Collection remoteBranches = branches.getRemoteBranches(); for (GitBranch remoteBranch : remoteBranches) { String name = remoteBranch.getName(); name = name.startsWith("remotes/") ? name.substring("remotes/".length()) : name;