incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r654436 - /incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResourceResolver.java
Date Thu, 08 May 2008 07:30:58 GMT
Author: fmeschbe
Date: Thu May  8 00:30:58 2008
New Revision: 654436

URL: http://svn.apache.org/viewvc?rev=654436&view=rev
Log:
Handle the setting the serarch path to "null" correctly, instead of bombing

Modified:
    incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResourceResolver.java

Modified: incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResourceResolver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResourceResolver.java?rev=654436&r1=654435&r2=654436&view=diff
==============================================================================
--- incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResourceResolver.java
(original)
+++ incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/sling/MockResourceResolver.java
Thu May  8 00:30:58 2008
@@ -138,13 +138,17 @@
     }
 
     public void setSearchPath(String... searchPath) {
-        this.searchPath = new String[searchPath.length];
-        for (int i=0; i < searchPath.length; i++) {
-            String entry = searchPath[i];
-            if (!entry.endsWith("/")) {
-                entry = entry.concat("/");
+        if (searchPath == null) {
+            this.searchPath = new String[0];
+        } else {
+            this.searchPath = new String[searchPath.length];
+            for (int i=0; i < searchPath.length; i++) {
+                String entry = searchPath[i];
+                if (!entry.endsWith("/")) {
+                    entry = entry.concat("/");
+                }
+                this.searchPath[i] = entry; 
             }
-            this.searchPath[i] = entry; 
         }
     }
 }



Mime
View raw message