Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 913 invoked from network); 3 Jan 2004 04:28:26 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 Jan 2004 04:28:26 -0000 Received: (qmail 68202 invoked by uid 500); 3 Jan 2004 04:28:02 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 68132 invoked by uid 500); 3 Jan 2004 04:28:02 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 68119 invoked from network); 3 Jan 2004 04:28:01 -0000 Received: from unknown (HELO hume.tsdinc.steitz.com) (209.249.229.10) by daedalus.apache.org with SMTP; 3 Jan 2004 04:28:01 -0000 Content-Class: urn:content-classes:message Received: from Lavoie.tsdinc.steitz.com ([209.249.229.4]) by hume.tsdinc.steitz.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 2 Jan 2004 23:28:02 -0500 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Received: from steitz.com ([130.13.97.135]) by Lavoie.tsdinc.steitz.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 2 Jan 2004 23:28:02 -0500 Message-ID: <3FF644DB.6030004@steitz.com> Date: Fri, 02 Jan 2004 21:28:11 -0700 From: "Phil Steitz" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Jakarta Commons Developers List" Subject: Re: [collections] CaseInsensitiveHashMap References: <7907946.1073048659641.JavaMail.root@127.0.0.1> <3FF59F2C.8060407@steitz.com> <004301c3d184$07bb27a0$24638051@oemcomputer> In-Reply-To: <004301c3d184$07bb27a0$24638051@oemcomputer> Content-Type: text/plain; format=flowed; charset="us-ascii" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Jan 2004 04:28:02.0771 (UTC) FILETIME=[F9D99A30:01C3D1B1] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Stephen Colebourne wrote: > From: "Phil Steitz" > >>>>2. I made no attempt at allowing the locale to be set or otherwise >>>>changing the default behavior of toLower() in convert(). >>> >>>I'm wondering how your implementation works. I was expecting the > > isEqualKey() method to be overridden, rather than converting the key on add. > (Note that the same code also has to go in a MapEntry) > >>Could be I was being too lazy. Since toLower() is "idempotent" (calling >>it repeatedly has same effect as calling it just once) it "works" to just >>override convert(), since in AbstractHashedMap, get, put, remove, >>containsKey, all start by converting the key (nice!). All I did was to >>extend HashedMap and override convert to return >>key.toString().toLowerCase(). The effect is that you actually store all >>lower case strings as keys (or null, once I fix this). The behavior should >>be the same as the impl that David Graham posted with PR #24537 (unless I >>am missing something -- quite possible). > > This impl will work, but I would prefer to see the case of the key > maintained, just the comparison to be case insensitive. Why exactly? Would you expect equals to distinguish CaseInsensitiveHashMaps that differ only on key case? Phil > > Stephen > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org