oleksii-novikov-onix commented on code in PR #4741:
URL: https://github.com/apache/fineract/pull/4741#discussion_r2127334510


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/s3/AmazonS3ConfigCondition.java:
##########
@@ -34,10 +34,8 @@ protected boolean matches(FineractProperties properties) {
     }
 
     private boolean isAwsCredentialValid() {
-        try {
-            // The credentials provider is intentionally not closed here since 
Spring will close it at the
-            // context closure event
-            DefaultCredentialsProvider.create().resolveCredentials();
+        try (DefaultCredentialsProvider credentialsProvider = 
DefaultCredentialsProvider.create()) {

Review Comment:
   I am not sure we can do that. DefaultCredentialsProvider.create() returns a 
singleton, so if you close the resource here, it will become unavailable 
afterward.
   



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