users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Null keys for MultivaluedMap

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Thu, 9 May 2013 15:16:51 +0100

Hi
On 09/05/13 13:50, Santiago Pericas-Geertsen wrote:
>
> On May 9, 2013, at 8:09 AM, Sergey Beryozkin<sberyozkin_at_talend.com> wrote:
>
>> On 09/05/13 12:59, Sergey Beryozkin wrote:
>>> Hi All,
>>>
>>> I can see there are some expectations MultivaluedMap are supposed to
>>> support null keys. I don't see anything in JavaDocs about it and IMHO we
>>> should not allow JAX-RS developers to do
>>>
>>> map.putSingle(null, something);
>> Well, I've learned something new today, LinkedHashMap and HashMap allows for null keys, so let it be. Though I'd prefer to block such keys, seriously, what does it mean for the JAX-RS runtime, when it attempts to say serialize the headers...And as it happens today is the first time when I'm seeing CXF MultivaluedMap impl failing with NPE due to null keys supplied, no users have tried it before :-)
>
> Can't you use the new implementation of this map in the 2.0 API?
>
Well, I've fixed our own implementation to accept 'null' keys. But I'm
thinking I'm just going the easy way here and should challenge accepting
null keys instead

Cheers, Sergey

> -- Santiago
>