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

[jsr339-experts] Re: [jax-rs-spec users] Re: Setting Response on ContainerResponseContext.setEntity

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Fri, 8 Mar 2013 16:38:04 +0100

On Mar 7, 2013, at 4:18 PM, Santiago Pericas-Geertsen <santiago.pericasgeertsen_at_Oracle.com> wrote:

>
> On Mar 7, 2013, at 7:17 AM, Sergey Beryozkin <sberyozkin_at_talend.com> wrote:
>
>> Hi
>>
>> We've had a case where a user set a newly built Response on ContainerResponseContext.setEntity(...).
>>
>> Should it cause IllegalArgumentException to minimize the confusion ?
>
> That seems reasonable to me.

I think a better solution is to warn about this in javadoc ...or to do nothing at all... You can never be completely fool-proof and this case is IMO rather marginal. E.g. we do not do anything in the case of ResponseBuilder.entity(...) either and most people don't complain.

Marek

>
> -- Santiago
>