users@jersey.java.net

[Jersey] Status.fromStatusCode(): returning UNKNOWN instead of NULL

From: cowwoc <cowwoc_at_bbs.darktech.org>
Date: Wed, 05 Feb 2014 17:58:01 -0500

Hi,

Instead of Status.fromStatusCode() returning null for unknown/custom
status codes, why don't you return an enum with a reserved value of
UNKNOWN? This would still allow people to look up the integer response
code, but at least those of us using:

switch (status)
{
}

could treat UNKNOWN and "default" in the same branch. Currently, we
cannot use a switch statement because it'll throw NullPointerException
on null values.

Gili