Polishing contribution

Closes gh-34942
This commit is contained in:
rstoyanchev
2025-06-04 13:17:52 +01:00
parent f9fa7cc93b
commit 230540b6da
34 changed files with 71 additions and 77 deletions

View File

@@ -59,7 +59,7 @@ public final class GenericTypeResolver {
* @param methodParameter the method parameter specification
* @param implementationClass the class to resolve type variables against
* @return the corresponding generic parameter or return type
* @deprecated since 5.2 in favor of {@code methodParameter.withContainingClass(implementationClass).getParameterType()}
* @deprecated in favor of {@code methodParameter.withContainingClass(implementationClass).getParameterType()}
*/
@Deprecated(since = "5.2")
public static Class<?> resolveParameterType(MethodParameter methodParameter, Class<?> implementationClass) {

View File

@@ -264,7 +264,7 @@ public class MethodParameter {
/**
* Increase this parameter's nesting level.
* @see #getNestingLevel()
* @deprecated since 5.2 in favor of {@link #nested(Integer)}
* @deprecated in favor of {@link #nested(Integer)}
*/
@Deprecated(since = "5.2")
public void increaseNestingLevel() {
@@ -274,7 +274,7 @@ public class MethodParameter {
/**
* Decrease this parameter's nesting level.
* @see #getNestingLevel()
* @deprecated since 5.2 in favor of retaining the original MethodParameter and
* @deprecated in favor of retaining the original MethodParameter and
* using {@link #nested(Integer)} if nesting is required
*/
@Deprecated(since = "5.2")
@@ -307,7 +307,7 @@ public class MethodParameter {
* @param typeIndex the corresponding type index
* (or {@code null} for the default type index)
* @see #getNestingLevel()
* @deprecated since 5.2 in favor of {@link #withTypeIndex}
* @deprecated in favor of {@link #withTypeIndex}
*/
@Deprecated(since = "5.2")
public void setTypeIndexForCurrentLevel(int typeIndex) {
@@ -758,7 +758,7 @@ public class MethodParameter {
* @param methodOrConstructor the Method or Constructor to specify a parameter for
* @param parameterIndex the index of the parameter
* @return the corresponding MethodParameter instance
* @deprecated as of 5.0, in favor of {@link #forExecutable}
* @deprecated in favor of {@link #forExecutable}
*/
@Deprecated(since = "5.0")
public static MethodParameter forMethodOrConstructor(Object methodOrConstructor, int parameterIndex) {

View File

@@ -75,9 +75,8 @@ public interface AnnotationFilter {
* {@link AnnotationFilter} that never matches and can be used when no
* filtering is needed (allowing for any annotation types to be present).
* @see #PLAIN
* @deprecated as of 5.2.6 since the {@link MergedAnnotations} model
* always ignores lang annotations according to the {@link #PLAIN} filter
* (for efficiency reasons)
* @deprecated since the {@link MergedAnnotations} model always ignores lang
* annotations according to the {@link #PLAIN} filter, for efficiency reasons
*/
@Deprecated(since = "5.2.6")
AnnotationFilter NONE = new AnnotationFilter() {

View File

@@ -263,7 +263,7 @@ public abstract class AnnotationUtils {
* failed to resolve at runtime)
* @since 4.0.8
* @see AnnotatedElement#getAnnotations()
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
* @deprecated since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated(since = "5.2")
public static Annotation @Nullable [] getAnnotations(AnnotatedElement annotatedElement) {
@@ -287,7 +287,7 @@ public abstract class AnnotationUtils {
* failed to resolve at runtime)
* @see org.springframework.core.BridgeMethodResolver#findBridgedMethod(Method)
* @see AnnotatedElement#getAnnotations()
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
* @deprecated since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated(since = "5.2")
public static Annotation @Nullable [] getAnnotations(Method method) {
@@ -326,7 +326,7 @@ public abstract class AnnotationUtils {
* @see org.springframework.core.BridgeMethodResolver#findBridgedMethod
* @see java.lang.annotation.Repeatable
* @see java.lang.reflect.AnnotatedElement#getAnnotationsByType
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
* @deprecated since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated(since = "5.2")
public static <A extends Annotation> Set<A> getRepeatableAnnotations(AnnotatedElement annotatedElement,
@@ -363,7 +363,7 @@ public abstract class AnnotationUtils {
* @see org.springframework.core.BridgeMethodResolver#findBridgedMethod
* @see java.lang.annotation.Repeatable
* @see java.lang.reflect.AnnotatedElement#getAnnotationsByType
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
* @deprecated since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated(since = "5.2")
public static <A extends Annotation> Set<A> getRepeatableAnnotations(AnnotatedElement annotatedElement,
@@ -407,7 +407,7 @@ public abstract class AnnotationUtils {
* @see org.springframework.core.BridgeMethodResolver#findBridgedMethod
* @see java.lang.annotation.Repeatable
* @see java.lang.reflect.AnnotatedElement#getDeclaredAnnotationsByType
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
* @deprecated since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated(since = "5.2")
public static <A extends Annotation> Set<A> getDeclaredRepeatableAnnotations(AnnotatedElement annotatedElement,
@@ -444,7 +444,7 @@ public abstract class AnnotationUtils {
* @see org.springframework.core.BridgeMethodResolver#findBridgedMethod
* @see java.lang.annotation.Repeatable
* @see java.lang.reflect.AnnotatedElement#getDeclaredAnnotationsByType
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
* @deprecated since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated(since = "5.2")
public static <A extends Annotation> Set<A> getDeclaredRepeatableAnnotations(AnnotatedElement annotatedElement,
@@ -595,7 +595,7 @@ public abstract class AnnotationUtils {
* or {@code null} if not found
* @see Class#isAnnotationPresent(Class)
* @see Class#getDeclaredAnnotations()
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
* @deprecated since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated(since = "5.2")
public static @Nullable Class<?> findAnnotationDeclaringClass(
@@ -631,7 +631,7 @@ public abstract class AnnotationUtils {
* @since 3.2.2
* @see Class#isAnnotationPresent(Class)
* @see Class#getDeclaredAnnotations()
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
* @deprecated since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated(since = "5.2")
public static @Nullable Class<?> findAnnotationDeclaringClassForTypes(
@@ -684,7 +684,7 @@ public abstract class AnnotationUtils {
* is <em>present</em> and <em>inherited</em>
* @see Class#isAnnotationPresent(Class)
* @see #isAnnotationDeclaredLocally(Class, Class)
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
* @deprecated since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated(since = "5.2")
public static boolean isAnnotationInherited(Class<? extends Annotation> annotationType, Class<?> clazz) {
@@ -702,7 +702,7 @@ public abstract class AnnotationUtils {
* @param metaAnnotationType the type of meta-annotation to search for
* @return {@code true} if such an annotation is meta-present
* @since 4.2.1
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
* @deprecated since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated(since = "5.2")
public static boolean isAnnotationMetaPresent(Class<? extends Annotation> annotationType,

View File

@@ -97,7 +97,7 @@ public abstract class AbstractDataBufferDecoder<T> extends AbstractDecoder<T> {
/**
* How to decode a {@code DataBuffer} to the target element type.
* @deprecated as of 5.2, please implement
* @deprecated in favor of implementing
* {@link #decode(DataBuffer, ResolvableType, MimeType, Map)} instead
*/
@Deprecated(since = "5.2")

View File

@@ -130,8 +130,7 @@ public interface Environment extends PropertyResolver {
* @see #getDefaultProfiles
* @see #matchesProfiles(String...)
* @see #acceptsProfiles(Profiles)
* @deprecated as of 5.1 in favor of {@link #acceptsProfiles(Profiles)} or
* {@link #matchesProfiles(String...)}
* @deprecated in favor of {@link #acceptsProfiles(Profiles)} or {@link #matchesProfiles(String...)}
*/
@Deprecated(since = "5.1")
boolean acceptsProfiles(String... profiles);

View File

@@ -46,14 +46,14 @@ public interface AsyncTaskExecutor extends TaskExecutor {
/**
* Constant that indicates immediate execution.
* @deprecated as of 5.3.16 along with {@link #execute(Runnable, long)}
* @deprecated along with {@link #execute(Runnable, long)}
*/
@Deprecated(since = "5.3.16")
long TIMEOUT_IMMEDIATE = 0;
/**
* Constant that indicates no time limit.
* @deprecated as of 5.3.16 along with {@link #execute(Runnable, long)}
* @deprecated along with {@link #execute(Runnable, long)}
*/
@Deprecated(since = "5.3.16")
long TIMEOUT_INDEFINITE = Long.MAX_VALUE;
@@ -72,7 +72,7 @@ public interface AsyncTaskExecutor extends TaskExecutor {
* of the timeout (i.e. it cannot be started in time)
* @throws TaskRejectedException if the given task was not accepted
* @see #execute(Runnable)
* @deprecated as of 5.3.16 since the common executors do not support start timeouts
* @deprecated since the common executors do not support start timeouts
*/
@Deprecated(since = "5.3.16")
default void execute(Runnable task, long startTimeout) {

View File

@@ -23,7 +23,7 @@ package org.springframework.core.task;
* @author Juergen Hoeller
* @since 2.0.3
* @see AsyncTaskExecutor#execute(Runnable, long)
* @deprecated as of 5.3.16 since the common executors do not support start timeouts
* @deprecated since the common executors do not support start timeouts
*/
@Deprecated(since = "5.3.16")
@SuppressWarnings("serial")

View File

@@ -58,7 +58,7 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
* Create a new {@code StandardAnnotationMetadata} wrapper for the given Class.
* @param introspectedClass the Class to introspect
* @see #StandardAnnotationMetadata(Class, boolean)
* @deprecated since 5.2 in favor of the factory method {@link AnnotationMetadata#introspect(Class)}
* @deprecated in favor of the factory method {@link AnnotationMetadata#introspect(Class)}
*/
@Deprecated(since = "5.2")
public StandardAnnotationMetadata(Class<?> introspectedClass) {
@@ -75,7 +75,7 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
* {@link org.springframework.core.annotation.AnnotationAttributes} for compatibility
* with ASM-based {@link AnnotationMetadata} implementations
* @since 3.1.1
* @deprecated since 5.2 in favor of the factory method {@link AnnotationMetadata#introspect(Class)}.
* @deprecated in favor of the factory method {@link AnnotationMetadata#introspect(Class)}.
* Use {@link MergedAnnotation#asMap(org.springframework.core.annotation.MergedAnnotation.Adapt...) MergedAnnotation.asMap}
* from {@link #getAnnotations()} rather than {@link #getAnnotationAttributes(String)}
* if {@code nestedAnnotationsAsMap} is {@code false}

View File

@@ -40,7 +40,7 @@ public class StandardClassMetadata implements ClassMetadata {
/**
* Create a new StandardClassMetadata wrapper for the given Class.
* @param introspectedClass the Class to introspect
* @deprecated since 5.2 in favor of {@link StandardAnnotationMetadata}
* @deprecated in favor of {@link StandardAnnotationMetadata}
*/
@Deprecated(since = "5.2")
public StandardClassMetadata(Class<?> introspectedClass) {

View File

@@ -52,7 +52,7 @@ public class StandardMethodMetadata implements MethodMetadata {
/**
* Create a new StandardMethodMetadata wrapper for the given Method.
* @param introspectedMethod the Method to introspect
* @deprecated since 5.2 in favor of obtaining instances via {@link AnnotationMetadata}
* @deprecated in favor of obtaining instances via {@link AnnotationMetadata}
*/
@Deprecated(since = "5.2")
public StandardMethodMetadata(Method introspectedMethod) {

View File

@@ -42,7 +42,7 @@ import javax.annotation.meta.TypeQualifierNickname;
* @author Sebastien Deleuze
* @author Juergen Hoeller
* @since 5.0
* @deprecated since 7.0; use {@link org.jspecify.annotations.NonNull} instead
* @deprecated use {@link org.jspecify.annotations.NonNull} instead
* @see NonNullApi
* @see NonNullFields
* @see Nullable

View File

@@ -38,7 +38,7 @@ import javax.annotation.meta.TypeQualifierDefault;
* @author Sebastien Deleuze
* @author Juergen Hoeller
* @since 5.0
* @deprecated since 7.0; use {@link org.jspecify.annotations.NullMarked} instead
* @deprecated use {@link org.jspecify.annotations.NullMarked} instead
* @see NonNullFields
* @see Nullable
* @see NonNull

View File

@@ -37,7 +37,7 @@ import javax.annotation.meta.TypeQualifierDefault;
*
* @author Sebastien Deleuze
* @since 5.0
* @deprecated since 7.0; use {@link org.jspecify.annotations.NullMarked} instead
* @deprecated use {@link org.jspecify.annotations.NullMarked} instead
* @see NonNullApi
* @see Nullable
* @see NonNull

View File

@@ -42,7 +42,7 @@ import javax.annotation.meta.TypeQualifierNickname;
* @author Sebastien Deleuze
* @author Juergen Hoeller
* @since 5.0
* @deprecated since 7.0; use {@link org.jspecify.annotations.Nullable} instead
* @deprecated use {@link org.jspecify.annotations.Nullable} instead
* @see NonNullApi
* @see NonNullFields
* @see NonNull

View File

@@ -939,7 +939,7 @@ public abstract class ClassUtils {
* Check whether the given object is a CGLIB proxy.
* @param object the object to check
* @see org.springframework.aop.support.AopUtils#isCglibProxy(Object)
* @deprecated as of 5.2, in favor of custom (possibly narrower) checks
* @deprecated in favor of custom (possibly narrower) checks
* such as for a Spring AOP proxy
*/
@Deprecated(since = "5.2")
@@ -951,7 +951,7 @@ public abstract class ClassUtils {
* Check whether the specified class is a CGLIB-generated class.
* @param clazz the class to check
* @see #getUserClass(Class)
* @deprecated as of 5.2, in favor of custom (possibly narrower) checks
* @deprecated in favor of custom (possibly narrower) checks
* or simply a check for containing {@link #CGLIB_CLASS_SEPARATOR}
*/
@Deprecated(since = "5.2")
@@ -963,7 +963,7 @@ public abstract class ClassUtils {
* Check whether the specified class name is a CGLIB-generated class.
* @param className the class name to check
* @see #CGLIB_CLASS_SEPARATOR
* @deprecated as of 5.2, in favor of custom (possibly narrower) checks
* @deprecated in favor of custom (possibly narrower) checks
* or simply a check for containing {@link #CGLIB_CLASS_SEPARATOR}
*/
@Deprecated(since = "5.2")

View File

@@ -105,8 +105,8 @@ public abstract class StringUtils {
* {@link #hasLength(String)} or {@link #hasText(String)} instead.</b>
* @param str the candidate object (possibly a {@code String})
* @since 3.2.1
* @deprecated as of 5.3, in favor of {@link #hasLength(String)} and
* {@link #hasText(String)} (or {@link ObjectUtils#isEmpty(Object)})
* @deprecated in favor of {@link #hasLength(String)} and {@link #hasText(String)}
* (or {@link ObjectUtils#isEmpty(Object)})
*/
@Deprecated(since = "5.3")
public static boolean isEmpty(@Nullable Object str) {