Browse Source

ReflogReaderTest: Open FileOutputStream in try-with-resource

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

5
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ReflogReaderTest.java

@ -277,11 +277,8 @@ public class ReflogReaderTest extends SampleDataRepositoryTestCase {
"oops, cannot create the directory for the test reflog file"
+ logfile);
}
FileOutputStream fileOutputStream = new FileOutputStream(logfile);
try {
try (FileOutputStream fileOutputStream = new FileOutputStream(logfile)) {
fileOutputStream.write(data);
} finally {
fileOutputStream.close();
}
}

Loading…
Cancel
Save