From torque-dev-return-10599-apmail-db-torque-dev-archive=db.apache.org@db.apache.org Wed Nov 2 19:00:26 2011 Return-Path: X-Original-To: apmail-db-torque-dev-archive@www.apache.org Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C00519EE2 for ; Wed, 2 Nov 2011 19:00:26 +0000 (UTC) Received: (qmail 70247 invoked by uid 500); 2 Nov 2011 19:00:26 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 70229 invoked by uid 500); 2 Nov 2011 19:00:26 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 70221 invoked by uid 500); 2 Nov 2011 19:00:25 -0000 Received: (qmail 70218 invoked by uid 99); 2 Nov 2011 19:00:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Nov 2011 19:00:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Wed, 02 Nov 2011 19:00:24 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C19532388CB5; Wed, 2 Nov 2011 19:00:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1196762 - /db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/SaxHelper.java Date: Wed, 02 Nov 2011 19:00:04 -0000 To: torque-commits@db.apache.org From: tfischer@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111102190004.C19532388CB5@eris.apache.org> Author: tfischer Date: Wed Nov 2 19:00:04 2011 New Revision: 1196762 URL: http://svn.apache.org/viewvc?rev=1196762&view=rev Log: Also allow 0 or 1 as boolean values Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/SaxHelper.java Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/SaxHelper.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/SaxHelper.java?rev=1196762&r1=1196761&r2=1196762&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/SaxHelper.java (original) +++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/SaxHelper.java Wed Nov 2 19:00:04 2011 @@ -19,7 +19,6 @@ package org.apache.torque.generator.conf * under the License. */ -import org.apache.commons.lang.StringUtils; import org.xml.sax.Attributes; import org.xml.sax.SAXException; @@ -48,7 +47,7 @@ public final class SaxHelper * @return the value of the attribute, or null if the attribute is not set. * * @throws SAXException if the attribute contains content - * other than "true" or "false" + * other than "true", "1" , "false" or "0". */ public static Boolean getBooleanAttribute( String attributeName, @@ -56,16 +55,18 @@ public final class SaxHelper String elementDescription) throws SAXException { - String acceptNotSet = attributes.getValue(attributeName); - if (acceptNotSet == null) + String attributeAsString = attributes.getValue(attributeName); + if (attributeAsString == null) { return null; } - if ("false".equals(acceptNotSet)) + if ("false".equals(attributeAsString) + || "0".equals(attributeAsString)) { return false; } - else if ("true".equals(acceptNotSet)) + else if ("true".equals(attributeAsString) + || "1".equals(attributeAsString)) { return true; } @@ -75,7 +76,7 @@ public final class SaxHelper + attributeName + "of " + elementDescription - + " must either be false or true"); + + " must either be false, 0, true or 1"); } } --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org