Consistent use of @Deprecated(since = "6.0")

This commit is contained in:
Sam Brannen
2022-09-20 14:32:27 +02:00
parent 91bca55cbf
commit 321092ce6f
101 changed files with 174 additions and 174 deletions

View File

@@ -42,7 +42,7 @@ public interface HttpRequest extends HttpMessage {
* @deprecated as of Spring Framework 6.0 in favor of {@link #getMethod()} and
* {@link HttpMethod#name()}
*/
@Deprecated
@Deprecated(since = "6.0")
String getMethodValue();
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 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.
@@ -823,7 +823,7 @@ public class MediaType extends MimeType implements Serializable {
* @param mediaTypes the list of media types to be sorted
* @deprecated As of 6.0, in favor of {@link MimeTypeUtils#sortBySpecificity(List)}
*/
@Deprecated
@Deprecated(since = "6.0")
public static void sortBySpecificity(List<MediaType> mediaTypes) {
Assert.notNull(mediaTypes, "'mediaTypes' must not be null");
if (mediaTypes.size() > 1) {
@@ -852,7 +852,7 @@ public class MediaType extends MimeType implements Serializable {
* @see #getQualityValue()
* @deprecated As of 6.0, with no direct replacement
*/
@Deprecated
@Deprecated(since = "6.0")
public static void sortByQualityValue(List<MediaType> mediaTypes) {
Assert.notNull(mediaTypes, "'mediaTypes' must not be null");
if (mediaTypes.size() > 1) {
@@ -865,7 +865,7 @@ public class MediaType extends MimeType implements Serializable {
* primary criteria and quality value the secondary.
* @deprecated As of 6.0, in favor of {@link MimeTypeUtils#sortBySpecificity(List)}
*/
@Deprecated
@Deprecated(since = "6.0")
public static void sortBySpecificityAndQuality(List<MediaType> mediaTypes) {
Assert.notNull(mediaTypes, "'mediaTypes' must not be null");
if (mediaTypes.size() > 1) {
@@ -878,7 +878,7 @@ public class MediaType extends MimeType implements Serializable {
* Comparator used by {@link #sortByQualityValue(List)}.
* @deprecated As of 6.0, with no direct replacement
*/
@Deprecated
@Deprecated(since = "6.0")
public static final Comparator<MediaType> QUALITY_VALUE_COMPARATOR = (mediaType1, mediaType2) -> {
double quality1 = mediaType1.getQualityValue();
double quality2 = mediaType2.getQualityValue();
@@ -918,7 +918,7 @@ public class MediaType extends MimeType implements Serializable {
* Comparator used by {@link #sortBySpecificity(List)}.
* @deprecated As of 6.0, with no direct replacement
*/
@Deprecated
@Deprecated(since = "6.0")
public static final Comparator<MediaType> SPECIFICITY_COMPARATOR = new SpecificityComparator<>() {
@Override

View File

@@ -157,7 +157,7 @@ public class ResponseEntity<T> extends HttpEntity<T> {
* @since 4.3
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}
*/
@Deprecated
@Deprecated(since = "6.0")
public int getStatusCodeValue() {
if (this.status instanceof HttpStatusCode statusCode) {
return statusCode.value();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2022 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,7 +27,7 @@ import org.springframework.http.HttpStatusCode;
* @since 3.1.1
* @deprecated as of 6.0, with no direct replacement
*/
@Deprecated
@Deprecated(since = "6.0")
public abstract class AbstractClientHttpResponse implements ClientHttpResponse {
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 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,7 +50,7 @@ public interface ClientHttpResponse extends HttpInputMessage, Closeable {
* @see #getStatusCode()
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}
*/
@Deprecated
@Deprecated(since = "6.0")
int getRawStatusCode() throws IOException;
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 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.
@@ -53,7 +53,7 @@ public interface ClientHttpResponse extends ReactiveHttpInputMessage {
* @see #getStatusCode()
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}
*/
@Deprecated
@Deprecated(since = "6.0")
int getRawStatusCode();
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 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.
@@ -68,7 +68,7 @@ public interface ServerHttpResponse extends ReactiveHttpOutputMessage {
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}
*/
@Nullable
@Deprecated
@Deprecated(since = "6.0")
default Integer getRawStatusCode() {
HttpStatusCode httpStatus = getStatusCode();
return (httpStatus != null ? httpStatus.value() : null);

View File

@@ -107,7 +107,7 @@ public class RestClientResponseException extends RestClientException {
* Return the raw HTTP status code value.
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}
*/
@Deprecated
@Deprecated(since = "6.0")
public int getRawStatusCode() {
return this.statusCode.value();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 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,7 +115,7 @@ public class UnknownContentTypeException extends RestClientException {
* Return the raw HTTP status code value.
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}
*/
@Deprecated
@Deprecated(since = "6.0")
public int getRawStatusCode() {
return this.statusCode.value();
}

View File

@@ -87,7 +87,7 @@ public class ModelAndViewContainer {
* @deprecated as of 6.0 without a replacement; once removed, the default
* model will always be ignored on redirect
*/
@Deprecated
@Deprecated(since = "6.0")
public void setIgnoreDefaultModelOnRedirect(boolean ignoreDefaultModelOnRedirect) {
this.ignoreDefaultModelOnRedirect = ignoreDefaultModelOnRedirect;
}

View File

@@ -81,7 +81,7 @@ public class MethodNotAllowedException extends ResponseStatusException {
* @since 5.1.13
* @deprecated as of 6.0 in favor of {@link #getHeaders()}
*/
@Deprecated
@Deprecated(since = "6.0")
@Override
public HttpHeaders getResponseHeaders() {
return getHeaders();

View File

@@ -76,7 +76,7 @@ public class NotAcceptableStatusException extends ResponseStatusException {
* @since 5.1.13
* @deprecated as of 6.0 in favor of {@link #getHeaders()}
*/
@Deprecated
@Deprecated(since = "6.0")
@Override
public HttpHeaders getResponseHeaders() {
return getHeaders();

View File

@@ -104,7 +104,7 @@ public class ResponseStatusException extends ErrorResponseException {
* @since 5.1.13
* @deprecated as of 6.0 in favor of {@link #getHeaders()}
*/
@Deprecated
@Deprecated(since = "6.0")
public HttpHeaders getResponseHeaders() {
return HttpHeaders.EMPTY;
}

View File

@@ -155,7 +155,7 @@ public class UnsupportedMediaTypeStatusException extends ResponseStatusException
* Delegates to {@link #getHeaders()}.
* @deprecated as of 6.0 in favor of {@link #getHeaders()}
*/
@Deprecated
@Deprecated(since = "6.0")
@Override
public HttpHeaders getResponseHeaders() {
return getHeaders();

View File

@@ -134,7 +134,7 @@ public class ResponseStatusExceptionHandler implements WebExceptionHandler {
* @since 5.3
* @deprecated as of 6.0, in favor of {@link #determineStatus(Throwable)}
*/
@Deprecated
@Deprecated(since = "6.0")
protected int determineRawStatusCode(Throwable ex) {
if (ex instanceof ResponseStatusException responseStatusException) {
return responseStatusException.getStatusCode().value();

View File

@@ -41,7 +41,7 @@ import org.springframework.lang.Nullable;
* @see org.springframework.core.NestedRuntimeException
* @deprecated as of 6.0, in favor of standard {@link ServletException} nesting
*/
@Deprecated
@Deprecated(since = "6.0")
public class NestedServletException extends ServletException {
/** Use serialVersionUID from Spring 1.2 for interoperability. */

View File

@@ -54,7 +54,7 @@ public class PathPatternParser {
* 6.0 in favor of configuring explicit redirects through a proxy,
* Servlet/web filter, or a controller.
*/
@Deprecated
@Deprecated(since = "6.0")
public void setMatchOptionalTrailingSeparator(boolean matchOptionalTrailingSeparator) {
this.matchOptionalTrailingSeparator = matchOptionalTrailingSeparator;
}
@@ -63,7 +63,7 @@ public class PathPatternParser {
* Whether optional trailing slashing match is enabled.
* @deprecated as of 6.0 together with {@link #setMatchOptionalTrailingSeparator(boolean)}.
*/
@Deprecated
@Deprecated(since = "6.0")
public boolean isMatchOptionalTrailingSeparator() {
return this.matchOptionalTrailingSeparator;
}