summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-03-06 09:49:16 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-03-06 09:49:16 +0900
commit6d437a58f1f68197a118529cefab207669592da4 (patch)
tree0045c1bea53029228cd950765b1cae6d9fbd2b7a
parent3393f78210862b3ccd954f029d831ef783b35c89 (diff)
downloadjgit-6d437a58f1f68197a118529cefab207669592da4.tar.gz
jgit-6d437a58f1f68197a118529cefab207669592da4.zip
DescribeCommandTest: Open FileWriter in try-with-resource
Change-Id: Ida79bdae652faa88fbdb1b81e7e10b5019ff2c16 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/DescribeCommandTest.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/DescribeCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/DescribeCommandTest.java
index d78a328402..79da2da7ea 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/DescribeCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/DescribeCommandTest.java
@@ -297,9 +297,9 @@ public class DescribeCommandTest extends RepositoryTestCase {
}
private static void touch(File f, String contents) throws Exception {
- FileWriter w = new FileWriter(f);
- w.write(contents);
- w.close();
+ try (FileWriter w = new FileWriter(f)) {
+ w.write(contents);
+ }
}
private String describe(ObjectId c1, boolean longDesc)