From eaa7c2051581ae479994d71aa0272025025d3648 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 5 Mar 2018 17:16:14 +0900 Subject: [PATCH] FileBasedConfigTest: Open FileOutputStream in try-with-resource Change-Id: Id4c49d4af30bcc5210d35630a8699574694060bb Signed-off-by: David Pursehouse --- .../org/eclipse/jgit/storage/file/FileBasedConfigTest.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java index 2a54dc614..7f0d60295 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java @@ -242,11 +242,8 @@ public class FileBasedConfigTest { dir.mkdirs(); File f = File.createTempFile(getClass().getName(), null, dir); - FileOutputStream os = new FileOutputStream(f, true); - try { + try (FileOutputStream os = new FileOutputStream(f, true)) { os.write(content); - } finally { - os.close(); } return f; }