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>
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;
*/
protected MockSystemReader mockSystemReader;
- private final List<Repository> toClose = new ArrayList<Repository>();
+ private final Set<Repository> toClose = new HashSet<>();
private File tmp;
@Before