Browse Source

RevObjectTest: Open RevWalk in try-with-resource

Change-Id: I19bcbb2f12036c5043436f3d544ccefbb7385b8d
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
stable-4.2
David Pursehouse 9 years ago
parent
commit
f0ef7748b4
  1. 9
      org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevObjectTest.java

9
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevObjectTest.java

@ -73,9 +73,12 @@ public class RevObjectTest extends RevWalkTestCase {
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);

Loading…
Cancel
Save