Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse2016-02-05 08:17:12 +0000
committerDavid Pursehouse2016-02-05 08:17:12 +0000
commitf0ef7748b4c4f16fe2a4b945c6076311ec56bddc (patch)
treeac912dae29f8841ea20c220a681d4fa6cb61549a
parent44f64de09166bc361dea71c3730cd8ec70e86a87 (diff)
downloadjgit-f0ef7748b4c4f16fe2a4b945c6076311ec56bddc.tar.gz
jgit-f0ef7748b4c4f16fe2a4b945c6076311ec56bddc.tar.xz
jgit-f0ef7748b4c4f16fe2a4b945c6076311ec56bddc.zip
RevObjectTest: Open RevWalk in try-with-resource
Change-Id: I19bcbb2f12036c5043436f3d544ccefbb7385b8d Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevObjectTest.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevObjectTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevObjectTest.java
index a768bef19e..95e7ca6d56 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevObjectTest.java
+++ b/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);

Back to the top