incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r835298 - /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry2.java
Date Thu, 12 Nov 2009 08:30:31 GMT
Author: ieb
Date: Thu Nov 12 08:30:31 2009
New Revision: 835298

URL: http://svn.apache.org/viewvc?rev=835298&view=rev
Log:
SLING-1181
Fixed registration of ResourceProviders that insert themselves into an existing tree.

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry2.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry2.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry2.java?rev=835298&r1=835297&r2=835298&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry2.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry2.java
Thu Nov 12 08:30:31 2009
@@ -166,8 +166,9 @@
                 Set<ResourceProvider> providersSet = new LinkedHashSet<ResourceProvider>();
                 getResourceProviders(path, providersSet);
                 
-                LOGGER.debug(" Provider Set for path {} {} ",path,Arrays.toString(providersSet.toArray(new
ResourceProvider[0])));
-
+                if ( LOGGER.isDebugEnabled()) {
+                    LOGGER.debug(" Provider Set for path {} {} ",path,Arrays.toString(providersSet.toArray(new
ResourceProvider[0])));
+                }
                 this.iteratorPath = path;
                 providers = providersSet.iterator();
                 delayed = new HashMap<String, Resource>();
@@ -347,6 +348,7 @@
             if (providers != null) {
                 set.addAll(Arrays.asList(providers));
             }
+            LOGGER.debug("Adding provider {} at {} ",provider,path);
             set.add(provider);
             providers = conditionalSort(set);
             return providers.length > before;
@@ -525,17 +527,27 @@
         for (String element : elements ) {
             if ( base.containsKey(element)) {
                 base = base.get(element);
+                if ( LOGGER.isDebugEnabled() ) {
+                    LOGGER.debug("Loading from {}  {} ", element, base.getResourceProviders().length
);
+                }
+                for ( ResourceProvider rp : base.getResourceProviders() ) {
+                    LOGGER.debug("Adding {} for {} ",rp,path);
+                    providers.add(rp);
+                }
             } else {
+                LOGGER.debug("No container for {} ", element );
                 base = null;
                 break;
             }
         }
         // the path has been exausted and there is a subtree to be collected, so go and collect
it.
         if ( base != null ) {
+            LOGGER.debug("Loading All below {} ", base.path );
             getResourceProviders(base, providers);
         }
         // add in providers at this node in the tree, ie the root provider
         for ( ResourceProvider rp : getResourceProviders() ) {
+            LOGGER.debug("Loading All at {} ", path );
             providers.add(rp);
         }
 



Mime
View raw message