Update deprecation notices on rawStatusCode

Mark for removal where not marked, and set to 7.0
consistently as the target for removal.

See gh-33440
This commit is contained in:
rstoyanchev
2024-08-28 18:49:49 +03:00
parent 57cb8c7abf
commit 186deb777f
27 changed files with 36 additions and 36 deletions

View File

@@ -61,7 +61,7 @@ public interface ClientResponse {
* Return the raw status code of this response.
* @return the HTTP status as an integer value
* @since 5.1
* @deprecated as of 6.0, in favor of {@link #statusCode()}
* @deprecated in favor of {@link #statusCode()}, for removal in 7.0
*/
@Deprecated(since = "6.0", forRemoval = true)
default int rawStatusCode() {

View File

@@ -795,7 +795,7 @@ public interface WebClient {
* .retrieve()
* .bodyToMono(Account.class)
* .onErrorResume(WebClientResponseException.class,
* ex -> ex.getRawStatusCode() == 404 ? Mono.empty() : Mono.error(ex));
* ex -> ex.getStatusCode().value() == 404 ? Mono.empty() : Mono.error(ex));
* </pre>
* @param statusPredicate to match responses with
* @param exceptionFunction to map the response to an error signal

View File

@@ -172,7 +172,7 @@ public class WebClientResponseException extends WebClientException {
/**
* Return the raw HTTP status code value.
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}
* @deprecated in favor of {@link #getStatusCode()}, for removal in 7.0
*/
@Deprecated(since = "6.0")
public int getRawStatusCode() {

View File

@@ -323,6 +323,7 @@ class DefaultServerResponseBuilder implements ServerResponse.BodyBuilder {
@Override
@Deprecated
@SuppressWarnings("removal")
public int rawStatusCode() {
return this.statusCode.value();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -70,9 +70,9 @@ public interface ServerResponse {
* Return the status code of this response as integer.
* @return the status as an integer
* @since 5.2
* @deprecated as of 6.0, in favor of {@link #statusCode()}
* @deprecated in favor of {@link #statusCode()}, for removal in 7.0
*/
@Deprecated(since = "6.0")
@Deprecated(since = "6.0", forRemoval = true)
int rawStatusCode();
/**

View File

@@ -84,7 +84,7 @@ class DefaultEntityResponseBuilderTests {
}
@Test
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
void status() {
String body = "foo";
Mono<EntityResponse<String>> result = EntityResponse.fromObject(body).status(HttpStatus.CREATED).build();

View File

@@ -80,7 +80,7 @@ class DefaultServerResponseBuilderTests {
}
@Test
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
void status() {
Mono<ServerResponse> result = ServerResponse.status(HttpStatus.CREATED).build();
StepVerifier.create(result)

View File

@@ -223,7 +223,7 @@ class RouterFunctionsTests {
public HttpStatus statusCode() {
return HttpStatus.OK;
}
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
@Override
public int rawStatusCode() {
return 200;
@@ -262,7 +262,7 @@ class RouterFunctionsTests {
public HttpStatus statusCode() {
return HttpStatus.OK;
}
@SuppressWarnings("deprecation")
@SuppressWarnings("removal")
@Override
public int rawStatusCode() {
return 200;