Browse Source

ReflogWriterTest: Open FileInputStream in try-with-resource

Change-Id: Ie111aead49d83d6acfbb89bb475ef6d3159b36c4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.11
David Pursehouse 7 years ago
parent
commit
5a1f8af589
  1. 5
      org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ReflogWriterTest.java

5
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" "oops, cannot create the directory for the test reflog file"
+ logfile); + logfile);
} }
FileInputStream fileInputStream = new FileInputStream(logfile); try (FileInputStream fileInputStream = new FileInputStream(logfile)) {
try {
fileInputStream.read(buffer); fileInputStream.read(buffer);
} finally {
fileInputStream.close();
} }
} }
} }

Loading…
Cancel
Save