diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java index 02b53b1297ff..0220cb9e8168 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java @@ -26,8 +26,8 @@ import org.jetbrains.annotations.NotNull; import org.zmlx.hg4idea.HgVcs; import org.zmlx.hg4idea.util.HgUtil; +import java.util.Collection; import java.util.Collections; -import java.util.List; /** @@ -40,7 +40,7 @@ public class HgRepositoryImpl extends RepositoryImpl implements HgRepository { @NotNull private final VirtualFile myHgDir; @NotNull private volatile String myCurrentBranch = DEFAULT_BRANCH; - @NotNull private volatile List myBranches = Collections.emptyList(); + @NotNull private volatile Collection myBranches = Collections.emptySet(); private boolean myIsFresh = true; @@ -84,7 +84,7 @@ public class HgRepositoryImpl extends RepositoryImpl implements HgRepository { @Override @NotNull - public List getBranches() { + public Collection getBranches() { return myBranches; } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java index 0ee66e2ec7c3..0659e39514c3 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java @@ -22,8 +22,9 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.io.File; -import java.util.ArrayList; -import java.util.List; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -77,8 +78,8 @@ public class HgRepositoryReader { } @NotNull - public List readBranches() { - List branches = new ArrayList(); + public Collection readBranches() { + Set branches = new HashSet(); if (!checkIsFresh()) { String[] branchesWithHeads = RepositoryUtil.tryLoadFile(myBranchHeadsFile).split("\n"); // first one - is a head revision: head hash + head number;