You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/11/04 17:17:10 UTC

[GitHub] [sling-org-apache-sling-resourceresolver] joerghoh commented on a change in pull request #52: SLING-10895 implement getPropertyMap()

joerghoh commented on a change in pull request #52:
URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/52#discussion_r743049595



##########
File path: src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
##########
@@ -180,8 +184,25 @@ public void close() {
         if (factory.shouldLogResourceResolverClosing()) {
             closedResolverException = new Exception("Stack Trace");
         }
+        clearPropertyMap();
         this.factory.unregister(this, this.control);
     }
+    
+    
+    protected void clearPropertyMap() {
+        if (propertyMap != null) {
+            for (Object value : propertyMap.values()) {
+                if (value instanceof Closeable) {
+                    try {
+                        ((Closeable) value).close();
+                    } catch (IOException e) {

Review comment:
       According to the API ResourceResolver.close does not throw an Exception.
   
   https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/ResourceResolver.html#close--




-- 
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: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org