From 30dc10ce4cb55684cde560b8b4497e0b9689ae34 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 5 Dec 2013 18:56:58 +0400 Subject: [PATCH] [git] IDEA-117500 Don't copy, just wrap in unmodifiable --- .../src/git4idea/branch/GitBranchesCollection.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java b/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java index 1ee5976e76b6..e3081f99b088 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchesCollection.java @@ -23,7 +23,6 @@ import org.jetbrains.annotations.NotNull; import java.util.Collection; import java.util.Collections; -import java.util.HashSet; /** *

@@ -49,20 +48,14 @@ public final class GitBranchesCollection { myLocalBranches = localBranches; } - /** - * @return the copy of local branches set. - */ @NotNull public Collection getLocalBranches() { - return new HashSet(myLocalBranches); + return Collections.unmodifiableCollection(myLocalBranches); } - /** - * @return the copy of remote branches set. - */ @NotNull public Collection getRemoteBranches() { - return new HashSet(myRemoteBranches); + return Collections.unmodifiableCollection(myRemoteBranches); } public GitLocalBranch findLocalBranch(@NotNull final String name) {