You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2019/09/24 07:28:24 UTC

[cxf] branch master updated: cxf-rt-rs-security-jose: close InputStream

This is an automated email from the ASF dual-hosted git repository.

buhhunyx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new f3320dc  cxf-rt-rs-security-jose: close InputStream
f3320dc is described below

commit f3320dc1aa543431afc8da48ddcde53b7d9b0b78
Author: Alexey Markevich <bu...@gmail.com>
AuthorDate: Tue Sep 24 10:27:52 2019 +0300

    cxf-rt-rs-security-jose: close InputStream
---
 .../org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java     | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
index 04e2219..d383bb2 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/common/KeyManagementUtils.java
@@ -315,8 +315,7 @@ public final class KeyManagementUtils {
         if (keyStorePswd == null) {
             throw new JoseException("No keystore password was defined");
         }
-        try {
-            InputStream is = JoseUtils.getResourceStream(keyStoreLoc, bus);
+        try (InputStream is = JoseUtils.getResourceStream(keyStoreLoc, bus)) {
             return CryptoUtils.loadKeyStore(is, keyStorePswd.toCharArray(), keyStoreType);
         } catch (Exception ex) {
             LOG.warning("Key store can not be loaded");