Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 89578 invoked from network); 18 Feb 2010 05:16:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Feb 2010 05:16:19 -0000 Received: (qmail 92121 invoked by uid 500); 18 Feb 2010 05:16:18 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 92006 invoked by uid 500); 18 Feb 2010 05:16:16 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 91992 invoked by uid 99); 18 Feb 2010 05:16:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Feb 2010 05:16:16 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [88.84.128.168] (HELO samaflost.de) (88.84.128.168) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Feb 2010 05:16:09 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by samaflost.de (Postfix) with ESMTP id CB36F40E0005 for ; Thu, 18 Feb 2010 06:15:47 +0100 (CET) Received: from samaflost.de ([127.0.0.1]) by localhost (v35516.1blu.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9N3IdJe44x33 for ; Thu, 18 Feb 2010 06:15:47 +0100 (CET) Received: by samaflost.de (Postfix, from userid 1000) id E8DC340E0004; Thu, 18 Feb 2010 06:15:46 +0100 (CET) From: Stefan Bodewig To: dev@ant.apache.org Subject: Re: svn commit: r910955 [1/2] - in /ant/core/trunk/src/main/org/apache/tools: ant/ ant/helper/ ant/launch/ ant/taskdefs/ ant/taskdefs/compilers/ ant/taskdefs/condition/ ant/taskdefs/email/ ant/taskdefs/optional/ejb/ ant/taskdefs/optional/image/ ant/taskdef... References: <20100217125853.9B81623889B3@eris.apache.org> <4B7C1F60.2090304@sun.com> X-Draft-From: ("nnfolder:mail.jakarta-ant" 98113) Date: Thu, 18 Feb 2010 06:15:43 +0100 In-Reply-To: <4B7C1F60.2090304@sun.com> (Jesse Glick's message of "Wed, 17 Feb 2010 11:54:56 -0500") Message-ID: <87aav72kg0.fsf@v35516.1blu.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On 2010-02-17, Jesse Glick wrote: > bodewig@apache.org wrote: >> if user input is compared to fixed strings in a case insensitive manner we should use the default locale. Use Locale.ENGLISH consistently > Perhaps I'm not understanding the point of this. >> URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Project.java?rev=910955&r1=910954&r2=910955&view=diff >> public static boolean toBoolean(String s) { >> - return ("on".equalsIgnoreCase(s) >> - || "true".equalsIgnoreCase(s) >> - || "yes".equalsIgnoreCase(s)); >>> String lc = s == null ? null : s.toLowerCase(Locale.ENGLISH); >>> return ("on".equals(lc) >>> || "true".equals(lc) >>> || "yes".equals(lc)); > This should result in exactly the same behavior, except slower. So... why? Because I misread the Javadocs, it seems. And I didn't perform any tests to back what I thought I read. The point I didn't see was that Character.toUpperCase is not Locale sensitive (which isn't spelled out explicitly). I'll revert most of the changes and transform the comparisions to equalsIgnoreCase where appropriate. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org