You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ju...@apache.org on 2012/08/29 03:47:57 UTC

svn commit: r1378422 - /sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java

Author: justin
Date: Wed Aug 29 01:47:56 2012
New Revision: 1378422

URL: http://svn.apache.org/viewvc?rev=1378422&view=rev
Log:
handling jcr:content child node case

Modified:
    sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java

Modified: sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java?rev=1378422&r1=1378421&r2=1378422&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java (original)
+++ sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java Wed Aug 29 01:47:56 2012
@@ -484,14 +484,23 @@ public class MapEntries implements Event
                 continue;
             }
 
-            final String parentPath = resource.getParent().getPath();
+            final String resourceName;
+            final String parentPath;
+            if (resource.getName().equals("jcr:content")) {
+                final Resource containingResource = resource.getParent();
+                parentPath = containingResource.getParent().getPath();
+                resourceName = containingResource.getName();
+            } else {
+                parentPath = resource.getParent().getPath();
+                resourceName = resource.getName();
+            }
             Map<String, String> parentMap = map.get(parentPath);
             if (parentMap == null) {
                 parentMap = new HashMap<String, String>();
                 map.put(parentPath, parentMap);
             }
             for (final String alias : props.get(ResourceResolverImpl.PROP_ALIAS, String[].class)) {
-                parentMap.put(alias, resource.getName());
+                parentMap.put(alias, resourceName);
             }
         }