From 5f082de9bb4c558775203f06a91e58f2dadd88de Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 6 Mar 2018 17:19:59 +0900 Subject: [PATCH] FileSnapshotTest: Open FileOutputStream in try-with-resource Change-Id: I187dd61e3e7d6f141722bf1af86a7fe04711057d Signed-off-by: David Pursehouse --- .../eclipse/jgit/internal/storage/file/FileSnapshotTest.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java index 999866605..9ceaa345d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileSnapshotTest.java @@ -135,11 +135,8 @@ public class FileSnapshotTest { } private static void append(File f, byte b) throws IOException { - FileOutputStream os = new FileOutputStream(f, true); - try { + try (FileOutputStream os = new FileOutputStream(f, true)) { os.write(b); - } finally { - os.close(); } }