Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate HttpStatus 103 CHECKPOINT in favor of new EARLY_HINTS #29816

Merged
merged 5 commits into from
Jan 16, 2023

Conversation

simonbasle
Copy link
Contributor

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

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 spring-projectsgh-27960
@simonbasle simonbasle added in: core Issues in core modules (aop, beans, core, context, expression) in: web Issues in web modules (web, webmvc, webflux, websocket) type: backport An issue that is a backport of another issue to a maintenance branch type: enhancement A general enhancement labels Jan 13, 2023
@simonbasle simonbasle self-assigned this Jan 13, 2023
@bclozel
Copy link
Member

bclozel commented Jan 13, 2023

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").

@simonbasle
Copy link
Contributor Author

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?

@bclozel
Copy link
Member

bclozel commented Jan 13, 2023

Sticking to 6.0 is fine I think. Backporting deprecations that late in the 5.x generation is not useful.

@simonbasle
Copy link
Contributor Author

simonbasle commented Jan 13, 2023

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.

@simonbasle simonbasle removed in: core Issues in core modules (aop, beans, core, context, expression) type: backport An issue that is a backport of another issue to a maintenance branch labels Jan 13, 2023
@simonbasle simonbasle added this to the 6.0.5 milestone Jan 13, 2023
@simonbasle simonbasle merged commit 5de1460 into spring-projects:main Jan 16, 2023
@simonbasle simonbasle deleted the earlyHintsHttp103 branch January 16, 2023 10:22
izeye added a commit to izeye/spring-framework that referenced this pull request Jan 18, 2023
simonbasle pushed a commit that referenced this pull request Jan 18, 2023
This commit polishes the EARLY_HINTS javadocs a bit:
 - fix a typo
 - fix `since` tags to include the patch version

See gh-29816
mdeinum pushed a commit to mdeinum/spring-framework that referenced this pull request Jun 29, 2023
…ng-projects#29816)

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 spring-projectsgh-27960
mdeinum pushed a commit to mdeinum/spring-framework that referenced this pull request Jun 29, 2023
This commit polishes the EARLY_HINTS javadocs a bit:
 - fix a typo
 - fix `since` tags to include the patch version

See spring-projectsgh-29816
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants