From 4ed7abcbd67ab23a0bf8b97437150def6debe478 Mon Sep 17 00:00:00 2001 From: seregamorph Date: Mon, 30 Mar 2026 13:11:06 +0200 Subject: [PATCH] Add missing @Deprecated.forRemoval Signed-off-by: seregamorph --- .../java/org/springframework/http/ResponseEntity.java | 2 +- .../converter/HttpMessageNotReadableException.java | 10 ++++++---- .../web/client/RestClientResponseException.java | 2 +- .../web/client/UnknownContentTypeException.java | 2 +- .../web/util/ContentCachingRequestWrapper.java | 3 +++ .../springframework/web/util/UriComponentsBuilder.java | 2 +- .../function/client/WebClientResponseException.java | 2 +- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/http/ResponseEntity.java b/spring-web/src/main/java/org/springframework/http/ResponseEntity.java index c5b2ae967416..1ca3d2a07eba 100644 --- a/spring-web/src/main/java/org/springframework/http/ResponseEntity.java +++ b/spring-web/src/main/java/org/springframework/http/ResponseEntity.java @@ -148,7 +148,7 @@ public HttpStatusCode getStatusCode() { * @deprecated as of 6.0, in favor of {@link #getStatusCode()}; scheduled * for removal in 7.0 */ - @Deprecated(since = "6.0") + @Deprecated(since = "6.0", forRemoval = true) public int getStatusCodeValue() { return getStatusCode().value(); } diff --git a/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotReadableException.java b/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotReadableException.java index 0b6d21ec800f..f1a85a4bcbb0 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotReadableException.java +++ b/spring-web/src/main/java/org/springframework/http/converter/HttpMessageNotReadableException.java @@ -38,9 +38,10 @@ public class HttpMessageNotReadableException extends HttpMessageConversionExcept /** * Create a new HttpMessageNotReadableException. * @param msg the detail message - * @deprecated as of 5.1, in favor of {@link #HttpMessageNotReadableException(String, HttpInputMessage)} + * @deprecated as of 5.1, in favor of {@link #HttpMessageNotReadableException(String, HttpInputMessage)}, + * for removal in 7.0 */ - @Deprecated + @Deprecated(forRemoval = true) public HttpMessageNotReadableException(String msg) { super(msg); this.httpInputMessage = null; @@ -50,9 +51,10 @@ public HttpMessageNotReadableException(String msg) { * Create a new HttpMessageNotReadableException. * @param msg the detail message * @param cause the root cause (if any) - * @deprecated as of 5.1, in favor of {@link #HttpMessageNotReadableException(String, Throwable, HttpInputMessage)} + * @deprecated as of 5.1, in favor of {@link #HttpMessageNotReadableException(String, Throwable, HttpInputMessage)}, + * for removal in 7.0 */ - @Deprecated + @Deprecated(forRemoval = true) public HttpMessageNotReadableException(String msg, @Nullable Throwable cause) { super(msg, cause); this.httpInputMessage = null; diff --git a/spring-web/src/main/java/org/springframework/web/client/RestClientResponseException.java b/spring-web/src/main/java/org/springframework/web/client/RestClientResponseException.java index 2205d54e7fe3..5143a3c558a8 100644 --- a/spring-web/src/main/java/org/springframework/web/client/RestClientResponseException.java +++ b/spring-web/src/main/java/org/springframework/web/client/RestClientResponseException.java @@ -127,7 +127,7 @@ public HttpStatusCode getStatusCode() { * Return the raw HTTP status code value. * @deprecated in favor of {@link #getStatusCode()}, for removal in 7.0 */ - @Deprecated(since = "6.0") + @Deprecated(since = "6.0", forRemoval = true) public int getRawStatusCode() { return this.statusCode.value(); } diff --git a/spring-web/src/main/java/org/springframework/web/client/UnknownContentTypeException.java b/spring-web/src/main/java/org/springframework/web/client/UnknownContentTypeException.java index 779b4894a12a..73aad50f7ee5 100644 --- a/spring-web/src/main/java/org/springframework/web/client/UnknownContentTypeException.java +++ b/spring-web/src/main/java/org/springframework/web/client/UnknownContentTypeException.java @@ -115,7 +115,7 @@ public HttpStatusCode getStatusCode() { * Return the raw HTTP status code value. * @deprecated in favor of {@link #getStatusCode()}, for removal in 7.0 */ - @Deprecated(since = "6.0") + @Deprecated(since = "6.0", forRemoval = true) public int getRawStatusCode() { return this.statusCode.value(); } diff --git a/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java b/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java index abfb70e40149..aeb7f9a4d82d 100644 --- a/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java +++ b/spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java @@ -71,7 +71,10 @@ public class ContentCachingRequestWrapper extends HttpServletRequestWrapper { /** * Create a new ContentCachingRequestWrapper for the given servlet request. * @param request the original servlet request + * @deprecated as of 6.2, in favor of {@link #ContentCachingRequestWrapper(HttpServletRequest, int)}, + * for removal in 7.0 */ + @Deprecated(forRemoval = true) public ContentCachingRequestWrapper(HttpServletRequest request) { super(request); int contentLength = request.getContentLength(); diff --git a/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java b/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java index 26c5690b5bd6..b62509153d7c 100644 --- a/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java +++ b/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java @@ -238,7 +238,7 @@ public static UriComponentsBuilder fromUriString(String uri, ParserType parserTy * @deprecated as of 6.2, in favor of {@link #fromUriString(String)}; * scheduled for removal in 7.0. */ - @Deprecated(since = "6.2") + @Deprecated(since = "6.2", forRemoval = true) public static UriComponentsBuilder fromHttpUrl(String httpUrl) throws InvalidUrlException { return fromUriString(httpUrl); } diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClientResponseException.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClientResponseException.java index fd84fc20d484..b0827e37bebc 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClientResponseException.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClientResponseException.java @@ -174,7 +174,7 @@ public HttpStatusCode getStatusCode() { * Return the raw HTTP status code value. * @deprecated in favor of {@link #getStatusCode()}, for removal in 7.0 */ - @Deprecated(since = "6.0") + @Deprecated(since = "6.0", forRemoval = true) public int getRawStatusCode() { return this.statusCode.value(); }