GitBranchesCollection: defensive copy.

This commit is contained in:
Kirill Likhodedov
2011-09-17 17:54:52 +04:00
parent 36899645c5
commit 1dd2ccae2b
@@ -47,14 +47,20 @@ public final class GitBranchesCollection {
myLocalBranches = localBranches;
}
/**
* @return the copy of local branches set.
*/
@NotNull
public Set<GitBranch> getLocalBranches() {
return myLocalBranches;
return new HashSet<GitBranch>(myLocalBranches);
}
/**
* @return the copy of remote branches set.
*/
@NotNull
public Set<GitBranch> getRemoteBranches() {
return myRemoteBranches;
return new HashSet<GitBranch>(myRemoteBranches);
}
/**