Mark ClientHttpResponse::getRawStatusCode for removal
This commit is contained in:
parent
033bebf8cd
commit
49d688f99c
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
|
@ -90,12 +90,6 @@ public class MockClientHttpResponse extends MockHttpInputMessage implements Clie
|
|||
return this.statusCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getRawStatusCode() {
|
||||
return this.statusCode.value();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusText() {
|
||||
return (this.statusCode instanceof HttpStatus status ? status.getReasonPhrase() : "");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
|
@ -27,10 +27,11 @@ import org.springframework.http.HttpStatusCode;
|
|||
* @since 3.1.1
|
||||
* @deprecated as of 6.0, with no direct replacement
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
public abstract class AbstractClientHttpResponse implements ClientHttpResponse {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("removal")
|
||||
public HttpStatusCode getStatusCode() throws IOException {
|
||||
return HttpStatusCode.valueOf(getRawStatusCode());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
|
@ -50,12 +50,6 @@ final class BufferingClientHttpResponseWrapper implements ClientHttpResponse {
|
|||
return this.response.getStatusCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getRawStatusCode() throws IOException {
|
||||
return this.response.getRawStatusCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusText() throws IOException {
|
||||
return this.response.getStatusText();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
|
@ -50,8 +50,10 @@ public interface ClientHttpResponse extends HttpInputMessage, Closeable {
|
|||
* @see #getStatusCode()
|
||||
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
int getRawStatusCode() throws IOException;
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
default int getRawStatusCode() throws IOException {
|
||||
return getStatusCode().value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTTP status text of the response.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
|
@ -57,12 +57,6 @@ final class HttpComponentsClientHttpResponse implements ClientHttpResponse {
|
|||
return HttpStatusCode.valueOf(this.httpResponse.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getRawStatusCode() {
|
||||
return this.httpResponse.getCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusText() {
|
||||
return this.httpResponse.getReasonPhrase();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
|
@ -54,12 +54,6 @@ class OkHttp3ClientHttpResponse implements ClientHttpResponse {
|
|||
return HttpStatusCode.valueOf(this.response.code());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getRawStatusCode() {
|
||||
return this.response.code();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusText() {
|
||||
return this.response.message();
|
||||
|
|
|
|||
|
|
@ -55,12 +55,6 @@ final class SimpleClientHttpResponse implements ClientHttpResponse {
|
|||
return HttpStatusCode.valueOf(this.connection.getResponseCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getRawStatusCode() throws IOException {
|
||||
return this.connection.getResponseCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusText() throws IOException {
|
||||
String result = this.connection.getResponseMessage();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
|
@ -55,12 +55,6 @@ class ClientHttpResponseDecorator implements ClientHttpResponse {
|
|||
return this.delegate.getStatusCode();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public int getRawStatusCode() throws IOException {
|
||||
return this.delegate.getRawStatusCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusText() throws IOException {
|
||||
return this.delegate.getStatusText();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
|
|
@ -90,12 +90,6 @@ public class MockClientHttpResponse extends MockHttpInputMessage implements Clie
|
|||
return this.statusCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getRawStatusCode() {
|
||||
return this.statusCode.value();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusText() {
|
||||
return (this.statusCode instanceof HttpStatus status ? status.getReasonPhrase() : "");
|
||||
|
|
|
|||
Loading…
Reference in New Issue