Polishing deprecated methods
Added since and forRemoval to Deprecated methods.
This commit is contained in:
parent
37b439182e
commit
9be6cea012
|
@ -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.
|
||||
|
@ -55,7 +55,7 @@ import org.springframework.util.StringUtils;
|
|||
* @see CronTrigger
|
||||
* @deprecated as of 5.3, in favor of {@link CronExpression}
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(since = "5.3", forRemoval = true)
|
||||
public class CronSequenceGenerator {
|
||||
|
||||
private final String expression;
|
||||
|
@ -84,7 +84,7 @@ public class CronSequenceGenerator {
|
|||
* @see java.util.TimeZone#getDefault()
|
||||
* @deprecated as of 5.3, in favor of {@link CronExpression#parse(String)}
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(since = "5.3", forRemoval = true)
|
||||
public CronSequenceGenerator(String expression) {
|
||||
this(expression, TimeZone.getDefault());
|
||||
}
|
||||
|
|
|
@ -708,7 +708,7 @@ public class MimeType implements Comparable<MimeType>, Serializable {
|
|||
* @param <T> the type of mime types that may be compared by this comparator
|
||||
* @deprecated As of 6.0, with no direct replacement
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
public static class SpecificityComparator<T extends MimeType> implements Comparator<T> {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -55,7 +55,8 @@ public abstract class MimeTypeUtils {
|
|||
* Comparator formally used by {@link #sortBySpecificity(List)}.
|
||||
* @deprecated As of 6.0, with no direct replacement
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
@SuppressWarnings("removal")
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
public static final Comparator<MimeType> SPECIFICITY_COMPARATOR = new MimeType.SpecificityComparator<>();
|
||||
|
||||
/**
|
||||
|
|
|
@ -221,9 +221,9 @@ public abstract class StringUtils {
|
|||
* @param str the {@code String} to check
|
||||
* @return the trimmed {@code String}
|
||||
* @see java.lang.Character#isWhitespace
|
||||
* @deprecated in favor of {@link String#strip()}
|
||||
* @deprecated since 6.0, in favor of {@link String#strip()}
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(since = "6.0")
|
||||
public static String trimWhitespace(String str) {
|
||||
if (!hasLength(str)) {
|
||||
return str;
|
||||
|
@ -277,9 +277,9 @@ public abstract class StringUtils {
|
|||
* @param str the {@code String} to check
|
||||
* @return the trimmed {@code String}
|
||||
* @see java.lang.Character#isWhitespace
|
||||
* @deprecated in favor of {@link String#stripLeading()}
|
||||
* @deprecated since 6.0, in favor of {@link String#stripLeading()}
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(since = "6.0")
|
||||
public static String trimLeadingWhitespace(String str) {
|
||||
if (!hasLength(str)) {
|
||||
return str;
|
||||
|
@ -293,9 +293,9 @@ public abstract class StringUtils {
|
|||
* @param str the {@code String} to check
|
||||
* @return the trimmed {@code String}
|
||||
* @see java.lang.Character#isWhitespace
|
||||
* @deprecated in favor of {@link String#stripTrailing()}
|
||||
* @deprecated since 6.0, in favor of {@link String#stripTrailing()}
|
||||
*/
|
||||
@Deprecated
|
||||
@Deprecated(since = "6.0")
|
||||
public static String trimTrailingWhitespace(String str) {
|
||||
if (!hasLength(str)) {
|
||||
return str;
|
||||
|
|
|
@ -98,7 +98,7 @@ class StringUtilsTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Deprecated
|
||||
@SuppressWarnings("deprecation")
|
||||
void trimLeadingWhitespace() {
|
||||
assertThat(StringUtils.trimLeadingWhitespace(null)).isNull();
|
||||
assertThat(StringUtils.trimLeadingWhitespace("")).isEqualTo("");
|
||||
|
@ -114,7 +114,7 @@ class StringUtilsTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Deprecated
|
||||
@SuppressWarnings("deprecation")
|
||||
void trimTrailingWhitespace() {
|
||||
assertThat(StringUtils.trimTrailingWhitespace(null)).isNull();
|
||||
assertThat(StringUtils.trimTrailingWhitespace("")).isEqualTo("");
|
||||
|
|
|
@ -836,7 +836,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(since = "6.0")
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
public static void sortBySpecificity(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 {
|
|||
* @see #getQualityValue()
|
||||
* @deprecated As of 6.0, with no direct replacement
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
public static void sortByQualityValue(List<MediaType> mediaTypes) {
|
||||
Assert.notNull(mediaTypes, "'mediaTypes' must not be null");
|
||||
if (mediaTypes.size() > 1) {
|
||||
|
@ -891,7 +891,7 @@ public class MediaType extends MimeType implements Serializable {
|
|||
* Comparator used by {@link #sortByQualityValue(List)}.
|
||||
* @deprecated As of 6.0, with no direct replacement
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
public static final Comparator<MediaType> QUALITY_VALUE_COMPARATOR = (mediaType1, mediaType2) -> {
|
||||
double quality1 = mediaType1.getQualityValue();
|
||||
double quality2 = mediaType2.getQualityValue();
|
||||
|
@ -931,7 +931,8 @@ public class MediaType extends MimeType implements Serializable {
|
|||
* Comparator used by {@link #sortBySpecificity(List)}.
|
||||
* @deprecated As of 6.0, with no direct replacement
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
@SuppressWarnings("removal")
|
||||
public static final Comparator<MediaType> SPECIFICITY_COMPARATOR = new SpecificityComparator<>() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -291,7 +291,7 @@ public class MediaTypeTests {
|
|||
MediaType allXml = new MediaType("application", "*+xml");
|
||||
MediaType all = MediaType.ALL;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("removal")
|
||||
Comparator<MediaType> comp = MediaType.SPECIFICITY_COMPARATOR;
|
||||
|
||||
// equal
|
||||
|
@ -335,7 +335,7 @@ public class MediaTypeTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("removal")
|
||||
public void sortBySpecificityRelated() {
|
||||
MediaType audioBasic = new MediaType("audio", "basic");
|
||||
MediaType audio = new MediaType("audio");
|
||||
|
@ -366,7 +366,7 @@ public class MediaTypeTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("removal")
|
||||
public void sortBySpecificityUnrelated() {
|
||||
MediaType audioBasic = new MediaType("audio", "basic");
|
||||
MediaType audioWave = new MediaType("audio", "wave");
|
||||
|
@ -398,7 +398,7 @@ public class MediaTypeTests {
|
|||
MediaType allXml = new MediaType("application", "*+xml");
|
||||
MediaType all = MediaType.ALL;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("removal")
|
||||
Comparator<MediaType> comp = MediaType.QUALITY_VALUE_COMPARATOR;
|
||||
|
||||
// equal
|
||||
|
@ -442,7 +442,7 @@ public class MediaTypeTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("removal")
|
||||
public void sortByQualityRelated() {
|
||||
MediaType audioBasic = new MediaType("audio", "basic");
|
||||
MediaType audio = new MediaType("audio");
|
||||
|
@ -473,7 +473,7 @@ public class MediaTypeTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("removal")
|
||||
public void sortByQualityUnrelated() {
|
||||
MediaType audioBasic = new MediaType("audio", "basic");
|
||||
MediaType audioWave = new MediaType("audio", "wave");
|
||||
|
|
Loading…
Reference in New Issue