diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-05 16:30:36 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-05 16:30:40 +0900 |
commit | 5a1f8af589deedc59d5fe9f7b20058f412a2bf17 (patch) | |
tree | 1743ee53119c874de5df5b8efca2ab056385f4e5 /org.eclipse.jgit.test | |
parent | 4c2f613a5a5d4beb39a28ef9ff88bb85cd049d53 (diff) | |
download | jgit-5a1f8af589deedc59d5fe9f7b20058f412a2bf17.tar.gz jgit-5a1f8af589deedc59d5fe9f7b20058f412a2bf17.zip |
ReflogWriterTest: Open FileInputStream in try-with-resource
Change-Id: Ie111aead49d83d6acfbb89bb475ef6d3159b36c4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ReflogWriterTest.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ReflogWriterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ReflogWriterTest.java index 7f40bae556..1d188c3148 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ReflogWriterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ReflogWriterTest.java @@ -87,11 +87,8 @@ public class ReflogWriterTest extends SampleDataRepositoryTestCase { "oops, cannot create the directory for the test reflog file" + logfile); } - FileInputStream fileInputStream = new FileInputStream(logfile); - try { + try (FileInputStream fileInputStream = new FileInputStream(logfile)) { fileInputStream.read(buffer); - } finally { - fileInputStream.close(); } } } |