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:
parent
57cb8c7abf
commit
186deb777f
|
|
@ -179,7 +179,7 @@ public class ExchangeResult {
|
|||
/**
|
||||
* Return the HTTP status code as an integer.
|
||||
* @since 5.1.10
|
||||
* @deprecated as of 6.0, in favor of {@link #getStatus()}
|
||||
* @deprecated in favor of {@link #getStatus()}, for removal in 7.0
|
||||
*/
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
public int getRawStatusCode() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 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.
|
||||
|
|
@ -25,7 +25,7 @@ import org.springframework.http.HttpStatusCode;
|
|||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 3.1.1
|
||||
* @deprecated as of 6.0, with no direct replacement; scheduled for removal in 6.2
|
||||
* @deprecated with no direct replacement; for removal in 6.2
|
||||
*/
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
public abstract class AbstractClientHttpResponse implements ClientHttpResponse {
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ public interface ClientHttpResponse extends HttpInputMessage, Closeable {
|
|||
* @throws IOException in case of I/O errors
|
||||
* @since 3.1.1
|
||||
* @see #getStatusCode()
|
||||
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}; scheduled for
|
||||
* removal in 6.2
|
||||
* @deprecated in favor of {@link #getStatusCode()}, for removal in 7.0
|
||||
*/
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
default int getRawStatusCode() throws IOException {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public interface ClientHttpResponse extends ReactiveHttpInputMessage {
|
|||
* @return the HTTP status as an integer value
|
||||
* @since 5.0.6
|
||||
* @see #getStatusCode()
|
||||
* @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", forRemoval = true)
|
||||
default int getRawStatusCode() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 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.
|
||||
|
|
@ -115,13 +115,6 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
|
|||
return setStatusCode(statusCode != null ? HttpStatusCode.valueOf(statusCode) : null);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
@Nullable
|
||||
public Integer getRawStatusCode() {
|
||||
return (this.statusCode != null ? this.statusCode.value() : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpHeaders getHeaders() {
|
||||
if (this.readOnlyHeaders != null) {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ class ReactorNetty2ServerHttpResponse extends AbstractServerHttpResponse impleme
|
|||
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("removal")
|
||||
public Integer getRawStatusCode() {
|
||||
Integer status = super.getRawStatusCode();
|
||||
return (status != null ? status : this.response.status().code());
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ class ReactorServerHttpResponse extends AbstractServerHttpResponse implements Ze
|
|||
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("removal")
|
||||
public Integer getRawStatusCode() {
|
||||
Integer status = super.getRawStatusCode();
|
||||
return (status != null ? status : this.response.status().code());
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ public interface ServerHttpResponse extends ReactiveHttpOutputMessage {
|
|||
* status of the response from the underlying server. The return value may
|
||||
* be {@code null} if there is no default value from the underlying server.
|
||||
* @since 5.2.4
|
||||
* @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")
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
@Nullable
|
||||
default Integer getRawStatusCode() {
|
||||
HttpStatusCode httpStatus = getStatusCode();
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -74,6 +74,7 @@ public class ServerHttpResponseDecorator implements ServerHttpResponse {
|
|||
@Override
|
||||
@Nullable
|
||||
@Deprecated
|
||||
@SuppressWarnings("removal")
|
||||
public Integer getRawStatusCode() {
|
||||
return getDelegate().getRawStatusCode();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ class ServletServerHttpResponse extends AbstractListenerServerHttpResponse {
|
|||
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("removal")
|
||||
public Integer getRawStatusCode() {
|
||||
Integer status = super.getRawStatusCode();
|
||||
return (status != null ? status : this.response.getStatus());
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ class UndertowServerHttpResponse extends AbstractListenerServerHttpResponse impl
|
|||
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("removal")
|
||||
public Integer getRawStatusCode() {
|
||||
Integer status = super.getRawStatusCode();
|
||||
return (status != null ? status : this.exchange.getStatusCode());
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class RestClientResponseException extends RestClientException {
|
|||
|
||||
/**
|
||||
* 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() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 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.
|
||||
|
|
@ -113,7 +113,7 @@ public class UnknownContentTypeException extends RestClientException {
|
|||
|
||||
/**
|
||||
* 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() {
|
||||
|
|
|
|||
|
|
@ -132,9 +132,9 @@ public class ResponseStatusExceptionHandler implements WebExceptionHandler {
|
|||
* @param ex the exception to check
|
||||
* @return the associated HTTP status code, or -1 if it can't be derived.
|
||||
* @since 5.3
|
||||
* @deprecated as of 6.0, in favor of {@link #determineStatus(Throwable)}
|
||||
* @deprecated in favor of {@link #determineStatus(Throwable)}, for removal in 7.0
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
protected int determineRawStatusCode(Throwable ex) {
|
||||
if (ex instanceof ResponseStatusException responseStatusException) {
|
||||
return responseStatusException.getStatusCode().value();
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -323,6 +323,7 @@ class DefaultServerResponseBuilder implements ServerResponse.BodyBuilder {
|
|||
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("removal")
|
||||
public int rawStatusCode() {
|
||||
return this.statusCode.value();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class DefaultServerResponseBuilderTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("removal")
|
||||
void status() {
|
||||
Mono<ServerResponse> result = ServerResponse.status(HttpStatus.CREATED).build();
|
||||
StepVerifier.create(result)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ abstract class AbstractServerResponse extends ErrorHandlingServerResponse {
|
|||
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("removal")
|
||||
public int rawStatusCode() {
|
||||
return this.statusCode.value();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ final class DefaultAsyncServerResponse extends ErrorHandlingServerResponse imple
|
|||
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("removal")
|
||||
public int rawStatusCode() {
|
||||
return delegate(ServerResponse::rawStatusCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,9 +68,9 @@ public interface ServerResponse {
|
|||
/**
|
||||
* Return the status code of this response as integer.
|
||||
* @return the status as an integer
|
||||
* @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();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class DefaultEntityResponseBuilderTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("removal")
|
||||
void status() {
|
||||
String body = "foo";
|
||||
EntityResponse<String> result =
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class DefaultServerResponseBuilderTests {
|
|||
static final ServerResponse.Context EMPTY_CONTEXT = Collections::emptyList;
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("removal")
|
||||
void status() {
|
||||
ServerResponse response = ServerResponse.status(HttpStatus.CREATED).build();
|
||||
assertThat(response.statusCode()).isEqualTo(HttpStatus.CREATED);
|
||||
|
|
|
|||
Loading…
Reference in New Issue