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

From: Santiago Pericas-Geertsen <>
Date: Thu, 9 May 2013 08:50:42 -0400

On May 9, 2013, at 8:09 AM, Sergey Beryozkin <> 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?

-- Santiago