From 5a1f8af589deedc59d5fe9f7b20058f412a2bf17 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 5 Mar 2018 16:30:36 +0900 Subject: ReflogWriterTest: Open FileInputStream in try-with-resource Change-Id: Ie111aead49d83d6acfbb89bb475ef6d3159b36c4 Signed-off-by: David Pursehouse --- .../tst/org/eclipse/jgit/internal/storage/file/ReflogWriterTest.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'org.eclipse.jgit.test') 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(); } } } -- cgit v1.2.3