jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: [jax-rs-spec users] Re: Response headers are writable without a builder

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Tue, 6 Mar 2012 13:06:16 -0500

On Mar 6, 2012, at 12:14 PM, Bill Burke wrote:

>
>
> On 3/5/12 3:38 PM, Santiago Pericas-Geertsen wrote:
>>
>> On Mar 5, 2012, at 10:56 AM, Bill Burke wrote:
>>
>>> Another thing that sucks about Response, ResponseBuilder, and modifying them in filters is that Response.getMetadata() allows you to modify the headers directly on the Response.
>>
>> How so? It states that it's equivalent to getHeaders().asMap() which returns a read-only map.
>>
>
> From the Javadoc:
>
> "* Get metadata associated with the response as a map. The returned map
> * may be subsequently modified by the JAX-RS runtime."

 Pretty much every data structure exposed as read-only to the API is modifiable by the JAX-RS runtime, isn't it? This statement does not imply that applications can update it IMO.

-- Santiago