users@jersey.java.net

[Jersey] Re: Reponse.Status != response.getStatusInfo()

From: cowwoc <cowwoc_at_bbs.darktech.org>
Date: Sat, 14 Dec 2013 00:07:22 -0500

I brought up this point a few months back too. I agree with Robert that
this seems to be a step backwards in terms of usability.

If I remember correctly, this change had to do with supporting custom
status codes but consider: the typical use-case is now more difficult.
Isn't it possible to keep the typical use-case simple while supporting
the more advanced use-case?

Gili

On 13/12/2013 7:54 PM, Robert DiFalco wrote:
> Wow, this migration to 2.4.1 from 1.9 has not been EASY!! Lots of
> needless changes, horrible documentation on migration, lack of old
> jersey path proxies that easy broken api fixes, etc.
>
> Anyway,
>
> If I have a line like this:
>
> rsp = target.request().post( bean );
>
> It seems like I Response.Status.CREATED will not compare to
> rsp.getStatusInfo(). Does anyone else find this to be crazy in the API
> design department?
>
> Okay, so I can fix it with this huge ass line:
>
> Repsonse.Status.CREATED.getStatusCode() == response.getStatus();
>
> But come on guys, really?
>
> assertEquals( Respone.Status.CREATED, response.getStatusInfo() );
>
> Won't work? This is an example of making it easier for the API
> implementor, not for the API user. There are about 100 ways to have
> done this better. Which one am I missing?