Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 38657 invoked from network); 9 Jan 2011 02:21:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Jan 2011 02:21:10 -0000 Received: (qmail 68037 invoked by uid 500); 9 Jan 2011 02:21:10 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 68010 invoked by uid 500); 9 Jan 2011 02:21:10 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 68003 invoked by uid 99); 9 Jan 2011 02:21:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Jan 2011 02:21:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Jan 2011 02:21:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E540223889EA; Sun, 9 Jan 2011 02:20:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@felix.apache.org From: fmeschbe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110109022049.E540223889EA@eris.apache.org> 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")); }