You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by pa...@apache.org on 2018/10/10 21:57:26 UTC

[sling-org-apache-sling-resourceresolver] branch master updated (e1587c2 -> cbf85dd)

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

pauls pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git.


    from e1587c2  trivial: added license header to *.md files
     new bbccfed  SLING-8006: Remove empty list of handlers if we removed the last handler from a handler list for a given path because the handler didn't activate.
     new cbf85dd  SLING-8006: Double check that the list is not used when empty to make sure.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../impl/providers/ResourceProviderTracker.java             | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)


[sling-org-apache-sling-resourceresolver] 01/02: SLING-8006: Remove empty list of handlers if we removed the last handler from a handler list for a given path because the handler didn't activate.

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git

commit bbccfed4e12e8ee909a8d3eb6b86ef962768ae5e
Author: Karl Pauls <ka...@gmail.com>
AuthorDate: Wed Oct 10 23:53:36 2018 +0200

    SLING-8006: Remove empty list of handlers if we removed the last handler from a handler list for a given path because the handler didn't activate.
---
 .../sling/resourceresolver/impl/providers/ResourceProviderTracker.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java
index 85cc1c3..97bb488 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java
@@ -202,6 +202,9 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
                        final List<ResourceProviderHandler> matchingHandlers = this.handlers.get(info.getPath());
                        if ( matchingHandlers != null && !matchingHandlers.isEmpty() && matchingHandlers.remove(activate) ) {
                            storage = null;
+                           if ( matchingHandlers.isEmpty() ) {
+                               this.handlers.remove(info.getPath());
+                           }
                        }
                    }
                }


[sling-org-apache-sling-resourceresolver] 02/02: SLING-8006: Double check that the list is not used when empty to make sure.

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git

commit cbf85ddfc9e417958152b42b4f0ac376866c7c10
Author: Karl Pauls <ka...@gmail.com>
AuthorDate: Wed Oct 10 23:57:15 2018 +0200

    SLING-8006: Double check that the list is not used when empty to make sure.
---
 .../impl/providers/ResourceProviderTracker.java                | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java
index 97bb488..98d60ff 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java
@@ -152,10 +152,12 @@ public class ResourceProviderTracker implements ResourceProviderStorageProvider
         synchronized ( this.handlers ) {
             this.reporterGenerator = generator;
             for (List<ResourceProviderHandler> list : handlers.values()) {
-                final ResourceProviderHandler h  = list.get(0);
-                if (h != null) {
-                    updateProviderContext(h);
-                    h.update();
+                if ( !list.isEmpty() ) {
+                    final ResourceProviderHandler h = list.get(0);
+                    if (h != null) {
+                        updateProviderContext(h);
+                        h.update();
+                    }
                 }
             }
         }