From: David Pursehouse Date: Fri, 27 Jan 2017 03:05:12 +0000 (+0900) Subject: LocalDiskRepositoryTestCase: Only add to toClose through access method X-Git-Tag: v4.7.0.201704051617-r~102 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5d0ca36d39fda934ca3304f2227afd4f93700393;p=jgit.git LocalDiskRepositoryTestCase: Only add to toClose through access method Only using the access method means we only have one place where the toClose set is modified, making it easier to debug either by adding log statements or by setting a breakpoint. Change-Id: I4f9f1774d5f2e10bcab381edfd84bb6ee0499a11 Signed-off-by: David Pursehouse --- 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 0a6defc3e2..42e201e932 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 @@ -364,7 +364,7 @@ public abstract class LocalDiskRepositoryTestCase { FileRepository db = new FileRepository(gitdir); assertFalse(gitdir.exists()); db.create(bare); - toClose.add(db); + addRepoToClose(db); return db; }