incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r691808 - /incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/servlets/AbstractServiceReferenceConfig.java
Date Wed, 03 Sep 2008 22:25:25 GMT
Author: fmeschbe
Date: Wed Sep  3 15:25:25 2008
New Revision: 691808

URL: http://svn.apache.org/viewvc?rev=691808&view=rev
Log:
Prevent ClassCastException when a servlet's name has to be deduced
from the service ID

Modified:
    incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/servlets/AbstractServiceReferenceConfig.java

Modified: incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/servlets/AbstractServiceReferenceConfig.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/servlets/AbstractServiceReferenceConfig.java?rev=691808&r1=691807&r2=691808&view=diff
==============================================================================
--- incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/servlets/AbstractServiceReferenceConfig.java
(original)
+++ incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/servlets/AbstractServiceReferenceConfig.java
Wed Sep  3 15:25:25 2008
@@ -118,7 +118,10 @@
         String servletName = null;
         for (int i = 0; i < NAME_PROPERTIES.length
             && (servletName == null || servletName.length() == 0); i++) {
-            servletName = (String) reference.getProperty(NAME_PROPERTIES[i]);
+            Object prop = reference.getProperty(NAME_PROPERTIES[i]);
+            if (prop != null) {
+                servletName = String.valueOf(prop);
+            }
         }
         return servletName;
     }



Mime
View raw message