From 8fbe225de579acd8efdc1d331b0dfa8c5dce850a Mon Sep 17 00:00:00 2001 From: Mikhail Filippov Date: Mon, 23 Aug 2021 13:06:28 +0300 Subject: [PATCH] Fix source compatibility with Java 6 --- .../test/com/sun/jna/platform/win32/Crypt32Test.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/platform/test/com/sun/jna/platform/win32/Crypt32Test.java b/contrib/platform/test/com/sun/jna/platform/win32/Crypt32Test.java index 835b73f792..a81af5bf7d 100644 --- a/contrib/platform/test/com/sun/jna/platform/win32/Crypt32Test.java +++ b/contrib/platform/test/com/sun/jna/platform/win32/Crypt32Test.java @@ -673,8 +673,14 @@ private Path createTestCrl() { crlBuilder.addExtension(Extension.cRLNumber, false, new CRLNumber(new BigInteger("2"))); X509CRLHolder holder = crlBuilder.build(caSigner); - try (OutputStream fos = Files.newOutputStream(tempFile)) { + OutputStream fos = null; + try { + fos = Files.newOutputStream(tempFile); fos.write(holder.getEncoded()); + } finally { + if (fos != null) { + fos.close(); + } } return tempFile;