You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2012/05/02 16:16:54 UTC

[jira] [Commented] (CXF-4280) case insensitive MetadataMap keyset

    [ https://issues.apache.org/jira/browse/CXF-4280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266581#comment-13266581 ] 

Sergey Beryozkin commented on CXF-4280:
---------------------------------------

Hi, sure, can you please type some test code here which exposes the issue this fix will address ?
I'm trying to fail one of the existing MetadataTests by using different map operations and can not :-)

I can only think of the following:
{code:java}
 // create a case-insensitive map
 MetadataMap<String, Object> m = new MetadataMap<String, Object>(false, true);
 m.add("Baz", "bar");
 assertEquals("bar", m.getFirst("Baz"));
 assertEquals("bar", m.getFirst("baz"));

 // checks the key set itself
 Set<String> keys = m.keySet();
 assertEquals(1, keys.size());
 assertTrue(keys.contains("Baz"));
 // this one currently fails
 assertTrue(keys.contains("baz")); 
{code}

Do you test the key set itself or do you get some application test due to the keySet() not use a case insensitive order on the trunk ?
                
> case insensitive MetadataMap keyset
> -----------------------------------
>
>                 Key: CXF-4280
>                 URL: https://issues.apache.org/jira/browse/CXF-4280
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5.3
>            Reporter: Romain Manni-Bucau
>
> while working on TCK for openejb/tomee we needed to do it:
> public class PatchedMetadataMap extends MetadataMap<String, String> {
>     public PatchedMetadataMap(Map<String, List<String>> store, boolean ro, boolean ci) {
>         super(store, ro, ci);
>     }
>     public Set<String> keySet() {
>         Set<String> set = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
>         set.addAll(super.keySet());
>         return set;
>     }
> }
> any way to merge it in cxf?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira