Skip to content

Commit 9ddbf80

Browse files
committed
Remove deprecated APIs in spring-web
See gh-33809
1 parent 00ee0ab commit 9ddbf80

File tree

16 files changed

+19
-545
lines changed

16 files changed

+19
-545
lines changed

spring-web/src/main/java/org/springframework/http/HttpStatus.java

+1-9
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-2025 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.
@@ -56,14 +56,6 @@ public enum HttpStatus implements HttpStatusCode {
5656
* @since 6.0.5
5757
*/
5858
EARLY_HINTS(103, Series.INFORMATIONAL, "Early Hints"),
59-
/**
60-
* {@code 103 Checkpoint}.
61-
* @see <a href="https://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal">A proposal for supporting
62-
* resumable POST/PUT HTTP requests in HTTP/1.0</a>
63-
* @deprecated in favor of {@link #EARLY_HINTS} which will be returned from {@code HttpStatus.valueOf(103)}
64-
*/
65-
@Deprecated(since = "6.0.5")
66-
CHECKPOINT(103, Series.INFORMATIONAL, "Checkpoint"),
6759

6860
// 2xx Success
6961

spring-web/src/main/java/org/springframework/http/ResponseEntity.java

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 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.
@@ -183,18 +183,6 @@ public HttpStatusCode getStatusCode() {
183183
return this.status;
184184
}
185185

186-
/**
187-
* Return the HTTP status code of the response.
188-
* @return the HTTP status as an int value
189-
* @since 4.3
190-
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}; scheduled
191-
* for removal in 7.0
192-
*/
193-
@Deprecated(since = "6.0")
194-
public int getStatusCodeValue() {
195-
return getStatusCode().value();
196-
}
197-
198186

199187
@Override
200188
public boolean equals(@Nullable Object other) {

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

-47
This file was deleted.

spring-web/src/main/java/org/springframework/web/client/UnknownContentTypeException.java

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 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.
@@ -112,15 +112,6 @@ public HttpStatusCode getStatusCode() {
112112
return this.statusCode;
113113
}
114114

115-
/**
116-
* Return the raw HTTP status code value.
117-
* @deprecated in favor of {@link #getStatusCode()}, for removal in 7.0
118-
*/
119-
@Deprecated(since = "6.0")
120-
public int getRawStatusCode() {
121-
return this.statusCode.value();
122-
}
123-
124115
/**
125116
* Return the HTTP status text.
126117
*/

spring-web/src/main/java/org/springframework/web/method/support/ModelAndViewContainer.java

+6-36
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-2025 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.
@@ -50,8 +50,6 @@
5050
*/
5151
public class ModelAndViewContainer {
5252

53-
private boolean ignoreDefaultModelOnRedirect = true;
54-
5553
private @Nullable Object view;
5654

5755
private final ModelMap defaultModel = new BindingAwareModelMap();
@@ -71,25 +69,6 @@ public class ModelAndViewContainer {
7169
private boolean requestHandled = false;
7270

7371

74-
/**
75-
* By default, the content of the "default" model is used both during
76-
* rendering and redirect scenarios. Alternatively controller methods
77-
* can declare an argument of type {@code RedirectAttributes} and use
78-
* it to provide attributes to prepare the redirect URL.
79-
* <p>Setting this flag to {@code true} guarantees the "default" model is
80-
* never used in a redirect scenario even if a RedirectAttributes argument
81-
* is not declared. Setting it to {@code false} means the "default" model
82-
* may be used in a redirect if the controller method doesn't declare a
83-
* RedirectAttributes argument.
84-
* <p>As of 6.0, this property is set to {@code true} by default.
85-
* @deprecated as of 6.0 without a replacement; once removed, the default
86-
* model will always be ignored on redirect
87-
*/
88-
@Deprecated(since = "6.0")
89-
public void setIgnoreDefaultModelOnRedirect(boolean ignoreDefaultModelOnRedirect) {
90-
this.ignoreDefaultModelOnRedirect = ignoreDefaultModelOnRedirect;
91-
}
92-
9372
/**
9473
* Set a view name to be resolved by the DispatcherServlet via a ViewResolver.
9574
* Will override any pre-existing view name or View.
@@ -137,22 +116,13 @@ public boolean isViewReference() {
137116
* a method argument) and {@code ignoreDefaultModelOnRedirect=false}.
138117
*/
139118
public ModelMap getModel() {
140-
if (useDefaultModel()) {
119+
if (!this.redirectModelScenario) {
141120
return this.defaultModel;
142121
}
143-
else {
144-
if (this.redirectModel == null) {
145-
this.redirectModel = new ModelMap();
146-
}
147-
return this.redirectModel;
122+
if (this.redirectModel == null) {
123+
this.redirectModel = new ModelMap();
148124
}
149-
}
150-
151-
/**
152-
* Whether to use the default model or the redirect model.
153-
*/
154-
private boolean useDefaultModel() {
155-
return (!this.redirectModelScenario || (this.redirectModel == null && !this.ignoreDefaultModelOnRedirect));
125+
return this.redirectModel;
156126
}
157127

158128
/**
@@ -336,7 +306,7 @@ public String toString() {
336306
else {
337307
sb.append("View is [").append(this.view).append(']');
338308
}
339-
if (useDefaultModel()) {
309+
if (!this.redirectModelScenario) {
340310
sb.append("; default model ");
341311
}
342312
else {

0 commit comments

Comments
 (0)