Skip to content

Commit 7aa25e0

Browse files
committed
Merge branch '6.1.x'
2 parents 5bcfcdd + 186deb7 commit 7aa25e0

27 files changed

+79
-31
lines changed

spring-test/src/main/java/org/springframework/test/web/reactive/server/ExchangeResult.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -176,6 +176,16 @@ public HttpStatusCode getStatus() {
176176
return this.response.getStatusCode();
177177
}
178178

179+
/**
180+
* Return the HTTP status code as an integer.
181+
* @since 5.1.10
182+
* @deprecated in favor of {@link #getStatus()}, for removal in 7.0
183+
*/
184+
@Deprecated(since = "6.0", forRemoval = true)
185+
public int getRawStatusCode() {
186+
return getStatus().value();
187+
}
188+
179189
/**
180190
* Return the response headers received from the server.
181191
*/

spring-web/src/main/java/org/springframework/http/client/ClientHttpResponse.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ public interface ClientHttpResponse extends HttpInputMessage, Closeable {
4242
*/
4343
HttpStatusCode getStatusCode() throws IOException;
4444

45+
/**
46+
* Get the HTTP status code as an integer.
47+
* @return the HTTP status as an integer value
48+
* @throws IOException in case of I/O errors
49+
* @since 3.1.1
50+
* @see #getStatusCode()
51+
* @deprecated in favor of {@link #getStatusCode()}, for removal in 7.0
52+
*/
53+
@Deprecated(since = "6.0", forRemoval = true)
54+
default int getRawStatusCode() throws IOException {
55+
return getStatusCode().value();
56+
}
57+
4558
/**
4659
* Get the HTTP status text of the response.
4760
* @return the HTTP status text

spring-web/src/main/java/org/springframework/http/client/reactive/ClientHttpResponse.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,6 +46,18 @@ default String getId() {
4646
*/
4747
HttpStatusCode getStatusCode();
4848

49+
/**
50+
* Return the HTTP status code as an integer.
51+
* @return the HTTP status as an integer value
52+
* @since 5.0.6
53+
* @see #getStatusCode()
54+
* @deprecated in favor of {@link #getStatusCode()}, for removal in 7.0
55+
*/
56+
@Deprecated(since = "6.0", forRemoval = true)
57+
default int getRawStatusCode() {
58+
return getStatusCode().value();
59+
}
60+
4961
/**
5062
* Return a read-only map of response cookies received from the server.
5163
*/

spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpResponse.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -115,13 +115,6 @@ public boolean setRawStatusCode(@Nullable Integer statusCode) {
115115
return setStatusCode(statusCode != null ? HttpStatusCode.valueOf(statusCode) : null);
116116
}
117117

118-
@Deprecated
119-
@Override
120-
@Nullable
121-
public Integer getRawStatusCode() {
122-
return (this.statusCode != null ? this.statusCode.value() : null);
123-
}
124-
125118
@Override
126119
public HttpHeaders getHeaders() {
127120
if (this.readOnlyHeaders != null) {

spring-web/src/main/java/org/springframework/http/server/reactive/ReactorNetty2ServerHttpResponse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public HttpStatusCode getStatusCode() {
7878

7979
@Override
8080
@Deprecated
81+
@SuppressWarnings("removal")
8182
public Integer getRawStatusCode() {
8283
Integer status = super.getRawStatusCode();
8384
return (status != null ? status : this.response.status().code());

spring-web/src/main/java/org/springframework/http/server/reactive/ReactorServerHttpResponse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public HttpStatusCode getStatusCode() {
7777

7878
@Override
7979
@Deprecated
80+
@SuppressWarnings("removal")
8081
public Integer getRawStatusCode() {
8182
Integer status = super.getRawStatusCode();
8283
return (status != null ? status : this.response.status().code());

spring-web/src/main/java/org/springframework/http/server/reactive/ServerHttpResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ default boolean setRawStatusCode(@Nullable Integer value) {
6565
* status of the response from the underlying server. The return value may
6666
* be {@code null} if there is no default value from the underlying server.
6767
* @since 5.2.4
68-
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}
68+
* @deprecated in favor of {@link #getStatusCode()}, for removal in 7.0
6969
*/
70-
@Deprecated(since = "6.0")
70+
@Deprecated(since = "6.0", forRemoval = true)
7171
@Nullable
7272
default Integer getRawStatusCode() {
7373
HttpStatusCode httpStatus = getStatusCode();

spring-web/src/main/java/org/springframework/http/server/reactive/ServerHttpResponseDecorator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -74,6 +74,7 @@ public boolean setRawStatusCode(@Nullable Integer value) {
7474
@Override
7575
@Nullable
7676
@Deprecated
77+
@SuppressWarnings("removal")
7778
public Integer getRawStatusCode() {
7879
return getDelegate().getRawStatusCode();
7980
}

spring-web/src/main/java/org/springframework/http/server/reactive/ServletServerHttpResponse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public HttpStatusCode getStatusCode() {
112112

113113
@Override
114114
@Deprecated
115+
@SuppressWarnings("removal")
115116
public Integer getRawStatusCode() {
116117
Integer status = super.getRawStatusCode();
117118
return (status != null ? status : this.response.getStatus());

spring-web/src/main/java/org/springframework/http/server/reactive/UndertowServerHttpResponse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public HttpStatusCode getStatusCode() {
8989

9090
@Override
9191
@Deprecated
92+
@SuppressWarnings("removal")
9293
public Integer getRawStatusCode() {
9394
Integer status = super.getRawStatusCode();
9495
return (status != null ? status : this.exchange.getStatusCode());

0 commit comments

Comments
 (0)