You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benjamin Bentmann (JIRA)" <ji...@apache.org> on 2008/05/11 11:31:55 UTC

[jira] Updated: (COLLECTIONS-294) Fix case-insensitive string handling

     [ https://issues.apache.org/jira/browse/COLLECTIONS-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated COLLECTIONS-294:
------------------------------------------

    Attachment: COLLECTIONS-294-CaseInsensitiveMap.patch

Yes, you're right, the map thing is trickier than I realized. Attached is a new patch that makes key comparisons behave as {{equalsIgnoreCase()}} would do (watch out for the extended unit test that fails when using {{String.toLowerCase()}} in {{convertKey()}}).

A question that pops up is whether {{CaseInsensitiveMap}} should have been case-preserving for keys, i.e. store keys in their original case but compare case-insensitively. I mean, there seem to be two different use cases involved here:
# case-insentive key lookup, i.e. {{map.get("key") == map.get("KEY")}} but possibly {{map.keySet().contains("Key")}}
# automatic key normalization to lower/upper case to provide a specific key set view


> Fix case-insensitive string handling
> ------------------------------------
>
>                 Key: COLLECTIONS-294
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-294
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Map
>    Affects Versions: 3.2
>            Reporter: Benjamin Bentmann
>         Attachments: COLLECTIONS-294-CaseInsensitiveMap.patch, COLLECTIONS-294.patch
>
>
> For example, the behavior of the {{CaseInsensitiveMap}} is 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.