incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r608800 - /incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/defaults/DefaultServlet.java
Date Fri, 04 Jan 2008 11:06:32 GMT
Author: cziegeler
Date: Fri Jan  4 03:06:29 2008
New Revision: 608800

URL: http://svn.apache.org/viewvc?rev=608800&view=rev
Log:
Prevent NPE if resource can't be mapped to a map.

Modified:
    incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/defaults/DefaultServlet.java

Modified: incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/defaults/DefaultServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/defaults/DefaultServlet.java?rev=608800&r1=608799&r2=608800&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/defaults/DefaultServlet.java
(original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/defaults/DefaultServlet.java
Fri Jan  4 03:06:29 2008
@@ -22,6 +22,7 @@
 import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
@@ -222,7 +223,7 @@
 
     @SuppressWarnings("unchecked")
     private Map<Object, Object> asMap(Resource resource) {
-        
+
         Object object = resource.adaptTo(Object.class);
         if (object != null) {
             if (object instanceof Map) {
@@ -233,6 +234,6 @@
         }
 
         // no objects available
-        return null;
+        return Collections.EMPTY_MAP; // unchecked cast
     }
 }



Mime
View raw message