reta commented on code in PR #2455:
URL: https://github.com/apache/cxf/pull/2455#discussion_r2141286682


##########
core/src/main/java/org/apache/cxf/configuration/jsse/TLSParameterJaxBUtils.java:
##########
@@ -153,12 +153,13 @@ public static KeyStore getKeyStore(KeyStoreType kst, 
boolean trustStore)
                 keyStore.load(kstInputStream, password);
             }
         } else if (kst.isSetResource()) {
-            final InputStream is = getResourceAsStream(kst.getResource());
-            if (is == null) {
-                final String msg =
-                    "Could not load keystore resource " + kst.getResource();
-                LOG.severe(msg);
-                throw new IOException(msg);
+            try (InputStream is = getResourceAsStream(kst.getResource())) {
+                if (is == null) {
+                    final String msg =
+                            "Could not load keystore resource " + 
kst.getResource();
+                    LOG.severe(msg);
+                    throw new IOException(msg);
+                }
             }
             keyStore.load(is, password);

Review Comment:
   This is not correct, `keyStore.load(is, password);` would be operating over 
closed stream



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to