From 5a1f8af589deedc59d5fe9f7b20058f412a2bf17 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 5 Mar 2018 16:30:36 +0900 Subject: [PATCH] ReflogWriterTest: Open FileInputStream in try-with-resource Change-Id: Ie111aead49d83d6acfbb89bb475ef6d3159b36c4 Signed-off-by: David Pursehouse --- .../eclipse/jgit/internal/storage/file/ReflogWriterTest.java | 5 +---- 1 file changed, 1 insertion(+), 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 7f40bae55..1d188c314 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(); } } }