This commit takes rfc8297 into account and introduces a newer code 103
HttpStatus value which uses Early Hints
as the more correct reason
phrase, deprecating the outdated CHECKPOINT
enum value for 103.
Additionally:
- HttpStatus.valueOf(103)
will return the new enum value
- HttpStatusCode#isSameCodeAs(HttpStatusCode)
is introduced to ease
comparison of deprecated enums vs their newer counterparts (or any
instance of a more generic HttpStatusCode
) by comparing the integer
value()
- HttpStatusTests
covers the new deprecation as well as the three
previously deprecated codes, including a check with the above new
method to ensure they have comparable integer values
Supersedes and Closes gh-27960
Comment From: bclozel
LGTM!
I think we tend to align all deprecations to look like the following: @Deprecated(since = "6.0", forRemoval = true)
.
Usage sites require @SuppressWarnings("removal")
.
Comment From: simonbasle
Good to know. I wonder if that should be a candidate for backport. I guess if we decided in favor of backport, the since
portion of the @Deprecated
in java would reflect that?
Comment From: bclozel
Sticking to 6.0 is fine I think. Backporting deprecations that late in the 5.x generation is not useful.
Comment From: simonbasle
Perfect. I've updated the @Deprecated
to add since
info.
I see a lot of occurrences of the annotation without any params (351 vs 182), and only 39 matches with forRemoval
, so I guess the later is only for elements that we strongly feel should be removed. I haven't used it as I don't think there is any particular urge to remove the deprecated enum value.