diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2017-01-27 11:32:18 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2017-01-27 16:00:06 +0900 |
commit | d69a829bdb6a79824804d4d56c4ac97ebe78bb30 (patch) | |
tree | ebbfd405ee186e857da6d391a7f967670e97e424 /org.eclipse.jgit.junit | |
parent | 2eb1bebd605852b7ef240e700943dfba7c0a1b3f (diff) | |
download | jgit-d69a829bdb6a79824804d4d56c4ac97ebe78bb30.tar.gz jgit-d69a829bdb6a79824804d4d56c4ac97ebe78bb30.zip |
LocalDiskRepositoryTestCase: Prevent duplicates in list of repos to close
Change the "toClose" list to a set, which will not allow duplicate
entries. This reduces the number of false positive logs about corrupt
use count due to the same repository being closed more than once during
teardown.
Change-Id: I5ab0ff8b56e7f2b2c7aab5274d957708d26f42c5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.junit')
-rw-r--r-- | org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java index dc2e8bfb71..0a6defc3e2 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java @@ -53,8 +53,10 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.TreeSet; import org.eclipse.jgit.dircache.DirCache; @@ -106,7 +108,7 @@ public abstract class LocalDiskRepositoryTestCase { */ protected MockSystemReader mockSystemReader; - private final List<Repository> toClose = new ArrayList<Repository>(); + private final Set<Repository> toClose = new HashSet<>(); private File tmp; @Before |