Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 10804 invoked from network); 25 May 2008 12:04:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 May 2008 12:04:25 -0000 Received: (qmail 5089 invoked by uid 500); 25 May 2008 12:04:26 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 5004 invoked by uid 500); 25 May 2008 12:04:26 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 4993 invoked by uid 99); 25 May 2008 12:04:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 May 2008 05:04:26 -0700 X-ASF-Spam-Status: No, hits=-1999.8 required=10.0 tests=ALL_TRUSTED,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 May 2008 12:03:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E1DDB234C122 for ; Sun, 25 May 2008 05:03:55 -0700 (PDT) Message-ID: <858442498.1211717035924.JavaMail.jira@brutus> Date: Sun, 25 May 2008 05:03:55 -0700 (PDT) From: "Benjamin Bentmann (JIRA)" To: issues@commons.apache.org Subject: [jira] Issue Comment Edited: (IO-167) Fix case-insensitive string handling In-Reply-To: <865161093.1209127797183.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IO-167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599677#action_12599677 ] bentmann edited comment on IO-167 at 5/25/08 5:02 AM: --------------------------------------------------------------- bq. Might be an idea to add a comment to the patch explaining that this is necessary to agree with String.equalsIgnoreCase(). I agree, these are the subtle things that are good to document. From the Javadoc of the method (latest patch): {code:java} * Note: The return value of this method does not necessarily match * the return value from {@link String#toLowerCase()}. Instead, the return value is * constructed to guarantee the following condition: str1.equalsIgnoreCase(str2) * if and only if convertCase(str1).equals(convertCase(str2)). {code} You could move this down into this method body, if it helps to catch the eye. But ultimatively, the unit test covers this code path, omitting either transformation to lower or upper case will fail the test. bq. As to whether wildcardMatch() should be platform-dependent or independent, there are probably use-cases for both. To advocate for the platform-independence, this is the use case I have in mind: Consider an open-source project with a world-wide operating dev community. Let's in particular assume that some Turkish developers participate. Let's say this project has some license file hanging around in their sources, named "LICENSE". This license should be picked up by some wildcard-based pattern, e.g. "license". As the case of the file name is usually quite irrelevant for the distro, people might want to do case-insensitive wildcard matching here. Now, for our Turkish team-mates the file name match fails. was (Author: bentmann): bq. Might be an idea to add a comment to the patch explaining that this is necessary to agree with String.equalsIgnoreCase(). I agree, these are the subtle things that are good to document. From the Javadoc of the method (latest patch): {code:java} * Note: The return value of this method does not necessarily match * the return value from {@link String#toLowerCase()}. Instead, the return value is * constructed to guarantee the following condition: str1.equalsIgnoreCase(str2) * if and only if convertCase(str1).equals(convertCase(str2)). {code} You could move this down into this method body, if it helps to catch the eye. bq. As to whether wildcardMatch() should be platform-dependent or independent, there are probably use-cases for both. To advocate for the platform-independence, this is the use case I have in mind: Consider an open-source project with a world-wide operating dev community. Let's in particular assume that some Turkish developers participate. Let's say this project has some license file hanging around in their sources, named "LICENSE". This license should be picked up by some wildcard-based pattern, e.g. "license". As the case of the file name is usually quite irrelevant for the distro, people might want to do case-insensitive wildcard matching here. Now, for our Turkish team-mates the file name match fails. > Fix case-insensitive string handling > ------------------------------------ > > Key: IO-167 > URL: https://issues.apache.org/jira/browse/IO-167 > Project: Commons IO > Issue Type: Bug > Affects Versions: 1.4 > Reporter: Benjamin Bentmann > Attachments: IO-167-a.patch, IO-167.patch, IO-167.patch > > > Case-insensitive operations are currently platform-dependent, please see [Common Bug #3|http://www.nabble.com/Re%3A-Common-Bugs-p14931921s177.html] for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.