Better handle non-String configuration properties
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1056866 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
index 487e64b..9233d71 100644
--- a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
+++ b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
@@ -181,21 +181,20 @@
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"));
}