[git] IDEA-117500 Don't copy, just wrap in unmodifiable

This commit is contained in:
Kirill Likhodedov
2013-12-05 18:56:58 +04:00
parent 587fd52d8c
commit 30dc10ce4c
@@ -23,7 +23,6 @@ import org.jetbrains.annotations.NotNull;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
/**
* <p>
@@ -49,20 +48,14 @@ public final class GitBranchesCollection {
myLocalBranches = localBranches;
}
/**
* @return the copy of local branches set.
*/
@NotNull
public Collection<GitLocalBranch> getLocalBranches() {
return new HashSet<GitLocalBranch>(myLocalBranches);
return Collections.unmodifiableCollection(myLocalBranches);
}
/**
* @return the copy of remote branches set.
*/
@NotNull
public Collection<GitRemoteBranch> getRemoteBranches() {
return new HashSet<GitRemoteBranch>(myRemoteBranches);
return Collections.unmodifiableCollection(myRemoteBranches);
}
public GitLocalBranch findLocalBranch(@NotNull final String name) {