incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1466432 - in /sling/trunk/bundles/resourceresolver/src: main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java test/java/org/apache/sling/resourceresolver/impl/ResourceResolverMangleNamespacesTest.java
Date Wed, 10 Apr 2013 11:34:33 GMT
Author: bdelacretaz
Date: Wed Apr 10 11:34:32 2013
New Revision: 1466432

URL: http://svn.apache.org/r1466432
Log:
SLING-2819 - check for null path in mangleNamespaces, and activate corresponding tests

Modified:
    sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
    sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceResolverMangleNamespacesTest.java

Modified: sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java?rev=1466432&r1=1466431&r2=1466432&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
(original)
+++ sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
Wed Apr 10 11:34:32 2013
@@ -966,7 +966,7 @@ public class ResourceResolverImpl extend
     }
 
     private String mangleNamespaces(String absPath) {
-        if (factory.isMangleNamespacePrefixes() && absPath.contains(MANGLE_NAMESPACE_OUT_SUFFIX))
{
+        if (factory.isMangleNamespacePrefixes() && absPath != null && absPath.contains(MANGLE_NAMESPACE_OUT_SUFFIX))
{
             final Pattern p = Pattern.compile(MANGLE_NAMESPACE_OUT);
             final Matcher m = p.matcher(absPath);
 

Modified: sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceResolverMangleNamespacesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceResolverMangleNamespacesTest.java?rev=1466432&r1=1466431&r2=1466432&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceResolverMangleNamespacesTest.java
(original)
+++ sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/ResourceResolverMangleNamespacesTest.java
Wed Apr 10 11:34:32 2013
@@ -27,7 +27,6 @@ import org.apache.sling.api.resource.Res
 import org.apache.sling.resourceresolver.impl.helper.ResourceResolverContext;
 import org.apache.sling.resourceresolver.impl.tree.RootResourceProviderEntry;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.Mockito;
@@ -116,7 +115,6 @@ public class ResourceResolverMangleNames
     }
     
     @Test 
-    @Ignore("SLING-2819")
     public void testUrlNoPath() {
         assertEquals("http://withSlash.com/", rr.map("http://withSlash.com/"));
         assertEquals("http://noSlash.com", rr.map("http://noSlash.com"));
@@ -124,7 +122,6 @@ public class ResourceResolverMangleNames
     }
     
     @Test 
-    @Ignore("SLING-2819")
     public void testWeirdCases() {
         assertEquals("http://foo", rr.map("http://foo"));
         assertEquals("http://", rr.map("http://"));



Mime
View raw message