You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:19:39 UTC

[sling-org-apache-sling-bundleresource-impl] 22/30: SLING-1733 - BundleResourceProvider would fail to find resources when multiple bundles had the same Sling-Bundle-Resources path

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

rombert pushed a commit to annotated tag org.apache.sling.bundleresource.impl-2.0.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-bundleresource-impl.git

commit 09847f07bf4c54ed10b3c5d13a7cfec8488db34b
Author: Eric Norman <en...@apache.org>
AuthorDate: Wed Sep 8 05:10:48 2010 +0000

    SLING-1733 - BundleResourceProvider would fail to find resources when multiple bundles had the same Sling-Bundle-Resources path
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/bundleresource@993606 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/bundleresource/impl/BundleResourceProvider.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
index 8e2e285..72870b6 100644
--- a/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
+++ b/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java
@@ -114,10 +114,11 @@ public class BundleResourceProvider implements ResourceProvider {
     public Iterator<Resource> listChildren(final Resource parent)
             throws SlingException {
 
-        // bundle resources can handle this request directly
-        if (parent instanceof BundleResource) {
-            return ((BundleResource) parent).listChildren();
-        }
+     	if (((BundleResource)parent).getBundle() == this.bundle) { 
+            // bundle resources can handle this request directly when the parent
+    		//  resource is in the same bundle as this provider.
+            return ((BundleResource) parent).listChildren(); 
+    	}
 
         // ensure this provider may have children of the parent
         String parentPath = parent.getPath();

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.