cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [cxf] branch 3.1.x-fixes updated: [CXF-7573] Closing InputStream
Date Mon, 04 Dec 2017 11:51:32 GMT
This is an automated email from the ASF dual-hosted git repository.

sergeyb pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.1.x-fixes by this push:
     new 2194b56  [CXF-7573] Closing InputStream
2194b56 is described below

commit 2194b5673d54766da3e2a59d236d251bfde7b50a
Author: Sergey Beryozkin <sberyozkin@gmail.com>
AuthorDate: Mon Dec 4 11:44:01 2017 +0000

    [CXF-7573] Closing InputStream
---
 .../src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
index 43b61a4..876b138 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwk/JwkUtils.java
@@ -276,7 +276,9 @@ public final class JwkUtils {
                 if (is == null) {
                     throw new JwkException("Error in loading keystore location: " + keyStoreLoc);
                 }
-                keyContent = IOUtils.readStringFromStream(is);
+                try (InputStream isResource = is) {
+                    keyContent = IOUtils.readStringFromStream(isResource);
+                }
             } catch (Exception ex) {
                 throw new JwkException(ex);
             }

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <commits@cxf.apache.org>'].

Mime
View raw message