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/04/25 16:31:59 UTC

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

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.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.


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

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COLLECTIONS-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609451#action_12609451 ] 

Henri Yandell commented on COLLECTIONS-294:
-------------------------------------------

Note: ExtendedProperties patch applied (r655204). I typo'd the key in the comment so it doesn't appear here.

> 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
>             Fix For: 3.3
>
>         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.


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

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COLLECTIONS-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12673928#action_12673928 ] 

Sebb commented on COLLECTIONS-294:
----------------------------------

Unfortunately, Locale(String) is Java 1.4+ only, and Collections still targets 1.3.

Replaced with Locale("tr","","") - which is what Java 1.4 does anyway

URL: http://svn.apache.org/viewvc?rev=744957&view=rev
Log:
COLLECTIONS-294: Replace Locale("tr") with Locale("tr","","") to be Java 1.3 compliant

> 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
>             Fix For: 3.3
>
>         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.


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

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COLLECTIONS-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed COLLECTIONS-294.
-------------------------------------

    Resolution: Fixed

svn ci -m "Applying Benjamin Bentmann's second patch from COLLECTIONS-294, fixing the locale issue in CaseInsensitiveMap by converting each character individually and not using toLowerCase" src

Sending        src/java/org/apache/commons/collections/map/CaseInsensitiveMap.java
Sending        src/test/org/apache/commons/collections/map/TestCaseInsensitiveMap.java
Transmitting file data ..
Committed revision 711168.

> 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
>             Fix For: 3.3
>
>         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.


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

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COLLECTIONS-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated COLLECTIONS-294:
--------------------------------------

    Fix Version/s: 3.3

> 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
>             Fix For: 3.3
>
>         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.


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

Posted by "Benjamin Bentmann (JIRA)" <ji...@apache.org>.
     [ 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.


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

Posted by "Benjamin Bentmann (JIRA)" <ji...@apache.org>.
     [ 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.patch

> 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.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.


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

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COLLECTIONS-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595862#action_12595862 ] 

Henri Yandell commented on COLLECTIONS-294:
-------------------------------------------

Definitely for the ExtendedProperties, it's obviously using English as a Locale.

I'm less convinced by CaseInsensitiveMap. Instead it seems that either:

a) It should have a Locale parameter to the constructor
b) It should be rewritten to be a CaseInsensitiveMap [ie: depend on equalsIgnoreCase], and not a ToLowerCaseMap as it currently is.

> 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.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.