diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-05 17:16:14 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-05 17:16:14 +0900 |
commit | eaa7c2051581ae479994d71aa0272025025d3648 (patch) | |
tree | 58006f97c475cbc2257c517ce0662e669e954447 /org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file | |
parent | fa9ee83697d1a8b4e6ffe90e8d488269cd5599f3 (diff) | |
download | jgit-eaa7c2051581ae479994d71aa0272025025d3648.tar.gz jgit-eaa7c2051581ae479994d71aa0272025025d3648.zip |
FileBasedConfigTest: Open FileOutputStream in try-with-resource
Change-Id: Id4c49d4af30bcc5210d35630a8699574694060bb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java | 5 |
1 files changed, 1 insertions, 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 2a54dc6140..7f0d60295c 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; } |