RevObjectTest: Open RevWalk in try-with-resource

Change-Id: I19bcbb2f12036c5043436f3d544ccefbb7385b8d
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
This commit is contained in:
David Pursehouse 2016-02-05 17:17:12 +09:00
parent 44f64de091
commit f0ef7748b4
1 changed files with 6 additions and 3 deletions

View File

@ -73,9 +73,12 @@ public void testEquals() throws Exception {
assertTrue(a1.equals((Object) a1));
assertFalse(a1.equals(""));
final RevWalk rw2 = new RevWalk(db);
final RevCommit a2 = rw2.parseCommit(a1);
final RevCommit b2 = rw2.parseCommit(b1);
final RevCommit a2;
final RevCommit b2;
try (final RevWalk rw2 = new RevWalk(db)) {
a2 = rw2.parseCommit(a1);
b2 = rw2.parseCommit(b1);
}
assertNotSame(a1, a2);
assertNotSame(b1, b2);