felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1056866 - /felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
Date Sun, 09 Jan 2011 02:20:49 GMT
Author: fmeschbe
Date: Sun Jan  9 02:20:49 2011
New Revision: 1056866

URL: http://svn.apache.org/viewvc?rev=1056866&view=rev
Log:
Better handle non-String configuration properties

Modified:
    felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java

Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java?rev=1056866&r1=1056865&r2=1056866&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
(original)
+++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
Sun Jan  9 02:20:49 2011
@@ -181,21 +181,20 @@ public final class JettyConfig
 
     private String getProperty(Dictionary props, String name, String defValue)
     {
-        String value = (String)props.get(name);
-        if (value == null) {
+        Object value = props.get(name);
+        if (value == null)
+        {
             value = this.context.getProperty(name);
         }
 
-        return value != null ? value : defValue;
+        return value != null ? String.valueOf(value) : defValue;
     }
 
     private boolean getBooleanProperty(Dictionary props, String name, boolean defValue)
     {
         String value = getProperty(props, name, null);
-        if (value == null) {
-            value = this.context.getProperty(name);
-        }
-        if (value != null) {
+        if (value != null)
+        {
             return (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes"));
         }
 



Mime
View raw message