incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1450227 - in /sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping: MapEntries.java MapEntry.java
Date Tue, 26 Feb 2013 15:41:50 GMT
Author: asanso
Date: Tue Feb 26 15:41:50 2013
New Revision: 1450227

URL: http://svn.apache.org/r1450227
Log:
SLING-2741 - Bad Vanity URL breaks whole Sling Resource Resolver

Modified:
    sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
    sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.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=1450227&r1=1450226&r2=1450227&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
Tue Feb 26 15:41:50 2013
@@ -442,7 +442,13 @@ public class MapEntries implements Event
             }
 
             // add resolution entries for this node
-            final MapEntry childResolveEntry = MapEntry.createResolveEntry(childPath, child,
trailingSlash);
+            MapEntry childResolveEntry = null;
+            try{
+            	childResolveEntry=MapEntry.createResolveEntry(childPath, child, trailingSlash);
+            }catch (IllegalArgumentException iae){
+        		//ignore this entry
+        		log.debug("ignored entry due exception ",iae);
+        	} 
             if (childResolveEntry != null) {
                 entries.add(childResolveEntry);
             }

Modified: sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java?rev=1450227&r1=1450226&r2=1450227&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
(original)
+++ sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntry.java
Tue Feb 26 15:41:50 2013
@@ -207,8 +207,18 @@ public class MapEntry implements Compara
                                 internalRedirect.length);
                 for (final String redir : internalRedirect) {
                     if (!redir.contains("$")) {
-                        prepEntries.add(new MapEntry(redir.concat(endHook),
-                                        status, trailingSlash, url));
+                    	MapEntry mapEntry = null;
+                    	try{
+                    		mapEntry = new MapEntry(redir.concat(endHook), status, trailingSlash,
url);
+                    	}catch (IllegalArgumentException iae){
+                    		//ignore this entry
+                            LoggerFactory
+                            .getLogger(MapEntry.class)
+                    		.debug("ignored entry due exception ",iae);
+                    	}     
+                    	if (mapEntry!=null){
+                    		prepEntries.add(mapEntry);
+                    	}
                     }
                 }
 



Mime
View raw message