Copilot commented on code in PR #13818:
URL: https://github.com/apache/cloudstack/pull/13818#discussion_r3728779615


##########
server/src/main/java/org/apache/cloudstack/network/ssl/CertServiceImpl.java:
##########
@@ -492,7 +488,12 @@ public Certificate parseCertificate(final String cert) {
         } catch (final CertificateException | IOException e) {
             throw new InvalidParameterValueException("Invalid Certificate 
format. Expected X509 certificate. Failed due to " + e.getMessage());
         } finally {
-            IOUtils.closeQuietly(certPem);
+            // Try to close quietly
+            try {
+                IOUtils.close(certPem);
+            } catch (IOException e) {
+                logger.debug("Failed to close pem reader", e);

Review Comment:
   The new resource-closing logic calls `IOUtils.close(certPem)`, but the 
codebase consistently uses `IOUtils.closeQuietly(...)` (e.g., 
agent/src/main/java/com/cloud/agent/dao/impl/PropertiesStorage.java:65). Using 
`closeQuietly` here keeps behavior consistent and avoids relying on a 
less-common IOUtils API variant.



-- 
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