RevObjectTest: Open RevWalk in try-with-resource
Change-Id: I19bcbb2f12036c5043436f3d544ccefbb7385b8d Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
This commit is contained in:
parent
44f64de091
commit
f0ef7748b4
|
@ -73,9 +73,12 @@ public void testEquals() throws Exception {
|
||||||
assertTrue(a1.equals((Object) a1));
|
assertTrue(a1.equals((Object) a1));
|
||||||
assertFalse(a1.equals(""));
|
assertFalse(a1.equals(""));
|
||||||
|
|
||||||
final RevWalk rw2 = new RevWalk(db);
|
final RevCommit a2;
|
||||||
final RevCommit a2 = rw2.parseCommit(a1);
|
final RevCommit b2;
|
||||||
final RevCommit b2 = rw2.parseCommit(b1);
|
try (final RevWalk rw2 = new RevWalk(db)) {
|
||||||
|
a2 = rw2.parseCommit(a1);
|
||||||
|
b2 = rw2.parseCommit(b1);
|
||||||
|
}
|
||||||
assertNotSame(a1, a2);
|
assertNotSame(a1, a2);
|
||||||
assertNotSame(b1, b2);
|
assertNotSame(b1, b2);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue