Skip to content

Commit 24fa9ea

Browse files
committed
Polish contribution
See gh-34223
1 parent 4acd9ee commit 24fa9ea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessor.java

+5-5
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.
@@ -241,17 +241,17 @@ else if (returnValue instanceof ProblemDetail detail) {
241241
}
242242

243243
if (httpEntity instanceof ResponseEntity<?> responseEntity) {
244-
HttpStatusCode httpStatusCode = responseEntity.getStatusCode();
245-
outputMessage.getServletResponse().setStatus(httpStatusCode.value());
246-
if (HttpStatus.OK.value() == httpStatusCode.value()) {
244+
HttpStatusCode returnStatus = responseEntity.getStatusCode();
245+
outputMessage.getServletResponse().setStatus(returnStatus.value());
246+
if (returnStatus.value() == HttpStatus.OK.value()) {
247247
HttpMethod method = inputMessage.getMethod();
248248
if ((HttpMethod.GET.equals(method) || HttpMethod.HEAD.equals(method))
249249
&& isResourceNotModified(inputMessage, outputMessage)) {
250250
outputMessage.flush();
251251
return;
252252
}
253253
}
254-
else if (httpStatusCode.is3xxRedirection()) {
254+
else if (returnStatus.is3xxRedirection()) {
255255
String location = outputHeaders.getFirst(HttpHeaders.LOCATION);
256256
if (location != null) {
257257
saveFlashAttributes(mavContainer, webRequest, location);

0 commit comments

Comments
 (0)