Add missing "since" in @Deprecated

See gh-34942

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
This commit is contained in:
Yanming Zhou
2025-05-26 17:38:18 +08:00
committed by rstoyanchev
parent b7dfd68d89
commit f9fa7cc93b
44 changed files with 111 additions and 111 deletions

View File

@@ -61,7 +61,7 @@ public final class GenericTypeResolver {
* @return the corresponding generic parameter or return type
* @deprecated since 5.2 in favor of {@code methodParameter.withContainingClass(implementationClass).getParameterType()}
*/
@Deprecated
@Deprecated(since = "5.2")
public static Class<?> resolveParameterType(MethodParameter methodParameter, Class<?> implementationClass) {
Assert.notNull(methodParameter, "MethodParameter must not be null");
Assert.notNull(implementationClass, "Class must not be null");

View File

@@ -266,7 +266,7 @@ public class MethodParameter {
* @see #getNestingLevel()
* @deprecated since 5.2 in favor of {@link #nested(Integer)}
*/
@Deprecated
@Deprecated(since = "5.2")
public void increaseNestingLevel() {
this.nestingLevel++;
}
@@ -277,7 +277,7 @@ public class MethodParameter {
* @deprecated since 5.2 in favor of retaining the original MethodParameter and
* using {@link #nested(Integer)} if nesting is required
*/
@Deprecated
@Deprecated(since = "5.2")
public void decreaseNestingLevel() {
getTypeIndexesPerLevel().remove(this.nestingLevel);
this.nestingLevel--;
@@ -309,7 +309,7 @@ public class MethodParameter {
* @see #getNestingLevel()
* @deprecated since 5.2 in favor of {@link #withTypeIndex}
*/
@Deprecated
@Deprecated(since = "5.2")
public void setTypeIndexForCurrentLevel(int typeIndex) {
getTypeIndexesPerLevel().put(this.nestingLevel, typeIndex);
}
@@ -429,7 +429,7 @@ public class MethodParameter {
/**
* Set a containing class to resolve the parameter type against.
*/
@Deprecated
@Deprecated(since = "5.2")
void setContainingClass(Class<?> containingClass) {
this.containingClass = containingClass;
this.parameterType = null;
@@ -449,7 +449,7 @@ public class MethodParameter {
/**
* Set a resolved (generic) parameter type.
*/
@Deprecated
@Deprecated(since = "5.2")
void setParameterType(@Nullable Class<?> parameterType) {
this.parameterType = parameterType;
}
@@ -760,7 +760,7 @@ public class MethodParameter {
* @return the corresponding MethodParameter instance
* @deprecated as of 5.0, in favor of {@link #forExecutable}
*/
@Deprecated
@Deprecated(since = "5.0")
public static MethodParameter forMethodOrConstructor(Object methodOrConstructor, int parameterIndex) {
if (!(methodOrConstructor instanceof Executable executable)) {
throw new IllegalArgumentException(

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2025 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.
@@ -79,7 +79,7 @@ public interface AnnotationFilter {
* always ignores lang annotations according to the {@link #PLAIN} filter
* (for efficiency reasons)
*/
@Deprecated
@Deprecated(since = "5.2.6")
AnnotationFilter NONE = new AnnotationFilter() {
@Override
public boolean matches(Annotation annotation) {

View File

@@ -265,7 +265,7 @@ public abstract class AnnotationUtils {
* @see AnnotatedElement#getAnnotations()
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated
@Deprecated(since = "5.2")
public static Annotation @Nullable [] getAnnotations(AnnotatedElement annotatedElement) {
try {
return synthesizeAnnotationArray(annotatedElement.getAnnotations(), annotatedElement);
@@ -289,7 +289,7 @@ public abstract class AnnotationUtils {
* @see AnnotatedElement#getAnnotations()
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated
@Deprecated(since = "5.2")
public static Annotation @Nullable [] getAnnotations(Method method) {
try {
return synthesizeAnnotationArray(BridgeMethodResolver.findBridgedMethod(method).getAnnotations(), method);
@@ -328,7 +328,7 @@ public abstract class AnnotationUtils {
* @see java.lang.reflect.AnnotatedElement#getAnnotationsByType
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated
@Deprecated(since = "5.2")
public static <A extends Annotation> Set<A> getRepeatableAnnotations(AnnotatedElement annotatedElement,
Class<A> annotationType) {
@@ -365,7 +365,7 @@ public abstract class AnnotationUtils {
* @see java.lang.reflect.AnnotatedElement#getAnnotationsByType
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated
@Deprecated(since = "5.2")
public static <A extends Annotation> Set<A> getRepeatableAnnotations(AnnotatedElement annotatedElement,
Class<A> annotationType, @Nullable Class<? extends Annotation> containerAnnotationType) {
@@ -409,7 +409,7 @@ public abstract class AnnotationUtils {
* @see java.lang.reflect.AnnotatedElement#getDeclaredAnnotationsByType
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated
@Deprecated(since = "5.2")
public static <A extends Annotation> Set<A> getDeclaredRepeatableAnnotations(AnnotatedElement annotatedElement,
Class<A> annotationType) {
@@ -446,7 +446,7 @@ public abstract class AnnotationUtils {
* @see java.lang.reflect.AnnotatedElement#getDeclaredAnnotationsByType
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated
@Deprecated(since = "5.2")
public static <A extends Annotation> Set<A> getDeclaredRepeatableAnnotations(AnnotatedElement annotatedElement,
Class<A> annotationType, @Nullable Class<? extends Annotation> containerAnnotationType) {
@@ -597,7 +597,7 @@ public abstract class AnnotationUtils {
* @see Class#getDeclaredAnnotations()
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated
@Deprecated(since = "5.2")
public static @Nullable Class<?> findAnnotationDeclaringClass(
Class<? extends Annotation> annotationType, @Nullable Class<?> clazz) {
@@ -633,7 +633,7 @@ public abstract class AnnotationUtils {
* @see Class#getDeclaredAnnotations()
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated
@Deprecated(since = "5.2")
public static @Nullable Class<?> findAnnotationDeclaringClassForTypes(
List<Class<? extends Annotation>> annotationTypes, @Nullable Class<?> clazz) {
@@ -686,7 +686,7 @@ public abstract class AnnotationUtils {
* @see #isAnnotationDeclaredLocally(Class, Class)
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated
@Deprecated(since = "5.2")
public static boolean isAnnotationInherited(Class<? extends Annotation> annotationType, Class<?> clazz) {
return MergedAnnotations.from(clazz, SearchStrategy.INHERITED_ANNOTATIONS)
.stream(annotationType)
@@ -704,7 +704,7 @@ public abstract class AnnotationUtils {
* @since 4.2.1
* @deprecated as of 5.2 since it is superseded by the {@link MergedAnnotations} API
*/
@Deprecated
@Deprecated(since = "5.2")
public static boolean isAnnotationMetaPresent(Class<? extends Annotation> annotationType,
@Nullable Class<? extends Annotation> metaAnnotationType) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2025 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.
@@ -100,7 +100,7 @@ public abstract class AbstractDataBufferDecoder<T> extends AbstractDecoder<T> {
* @deprecated as of 5.2, please implement
* {@link #decode(DataBuffer, ResolvableType, MimeType, Map)} instead
*/
@Deprecated
@Deprecated(since = "5.2")
protected @Nullable T decodeDataBuffer(DataBuffer buffer, ResolvableType elementType,
@Nullable MimeType mimeType, @Nullable Map<String, Object> hints) {

View File

@@ -377,7 +377,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
}
@Override
@Deprecated
@Deprecated(since = "5.1")
public boolean acceptsProfiles(String... profiles) {
Assert.notEmpty(profiles, "Must specify at least one profile");
for (String profile : profiles) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2025 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.
@@ -133,7 +133,7 @@ public interface Environment extends PropertyResolver {
* @deprecated as of 5.1 in favor of {@link #acceptsProfiles(Profiles)} or
* {@link #matchesProfiles(String...)}
*/
@Deprecated
@Deprecated(since = "5.1")
boolean acceptsProfiles(String... profiles);
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2025 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.
@@ -48,14 +48,14 @@ public interface AsyncTaskExecutor extends TaskExecutor {
* Constant that indicates immediate execution.
* @deprecated as of 5.3.16 along with {@link #execute(Runnable, long)}
*/
@Deprecated
@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
@Deprecated(since = "5.3.16")
long TIMEOUT_INDEFINITE = Long.MAX_VALUE;
@@ -74,7 +74,7 @@ public interface AsyncTaskExecutor extends TaskExecutor {
* @see #execute(Runnable)
* @deprecated as of 5.3.16 since the common executors do not support start timeouts
*/
@Deprecated
@Deprecated(since = "5.3.16")
default void execute(Runnable task, long startTimeout) {
execute(task);
}

View File

@@ -264,7 +264,7 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator
* @see #TIMEOUT_IMMEDIATE
* @see #doExecute(Runnable)
*/
@Deprecated
@Deprecated(since = "5.3.16")
@Override
public void execute(Runnable task, long startTimeout) {
Assert.notNull(task, "Runnable must not be null");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2025 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.
@@ -25,7 +25,7 @@ package org.springframework.core.task;
* @see AsyncTaskExecutor#execute(Runnable, long)
* @deprecated as of 5.3.16 since the common executors do not support start timeouts
*/
@Deprecated
@Deprecated(since = "5.3.16")
@SuppressWarnings("serial")
public class TaskTimeoutException extends TaskRejectedException {

View File

@@ -60,7 +60,7 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
* @see #StandardAnnotationMetadata(Class, boolean)
* @deprecated since 5.2 in favor of the factory method {@link AnnotationMetadata#introspect(Class)}
*/
@Deprecated
@Deprecated(since = "5.2")
public StandardAnnotationMetadata(Class<?> introspectedClass) {
this(introspectedClass, false);
}
@@ -80,7 +80,7 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
* from {@link #getAnnotations()} rather than {@link #getAnnotationAttributes(String)}
* if {@code nestedAnnotationsAsMap} is {@code false}
*/
@Deprecated
@Deprecated(since = "5.2")
public StandardAnnotationMetadata(Class<?> introspectedClass, boolean nestedAnnotationsAsMap) {
super(introspectedClass);
this.mergedAnnotations = MergedAnnotations.from(introspectedClass,

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2025 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.
@@ -42,7 +42,7 @@ public class StandardClassMetadata implements ClassMetadata {
* @param introspectedClass the Class to introspect
* @deprecated since 5.2 in favor of {@link StandardAnnotationMetadata}
*/
@Deprecated
@Deprecated(since = "5.2")
public StandardClassMetadata(Class<?> introspectedClass) {
Assert.notNull(introspectedClass, "Class must not be null");
this.introspectedClass = introspectedClass;

View File

@@ -54,7 +54,7 @@ public class StandardMethodMetadata implements MethodMetadata {
* @param introspectedMethod the Method to introspect
* @deprecated since 5.2 in favor of obtaining instances via {@link AnnotationMetadata}
*/
@Deprecated
@Deprecated(since = "5.2")
public StandardMethodMetadata(Method introspectedMethod) {
this(introspectedMethod, false);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 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.
@@ -52,6 +52,6 @@ import javax.annotation.meta.TypeQualifierNickname;
@Documented
@Nonnull
@TypeQualifierNickname
@Deprecated
@Deprecated(since = "7.0")
public @interface NonNull {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 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.
@@ -48,6 +48,6 @@ import javax.annotation.meta.TypeQualifierDefault;
@Documented
@Nonnull
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER})
@Deprecated
@Deprecated(since = "7.0")
public @interface NonNullApi {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 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.
@@ -47,6 +47,6 @@ import javax.annotation.meta.TypeQualifierDefault;
@Documented
@Nonnull
@TypeQualifierDefault(ElementType.FIELD)
@Deprecated
@Deprecated(since = "7.0")
public @interface NonNullFields {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 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.
@@ -52,6 +52,6 @@ import javax.annotation.meta.TypeQualifierNickname;
@Documented
@CheckForNull
@TypeQualifierNickname
@Deprecated
@Deprecated(since = "7.0")
public @interface Nullable {
}

View File

@@ -942,7 +942,7 @@ public abstract class ClassUtils {
* @deprecated as of 5.2, in favor of custom (possibly narrower) checks
* such as for a Spring AOP proxy
*/
@Deprecated
@Deprecated(since = "5.2")
public static boolean isCglibProxy(Object object) {
return isCglibProxyClass(object.getClass());
}
@@ -954,7 +954,7 @@ public abstract class ClassUtils {
* @deprecated as of 5.2, in favor of custom (possibly narrower) checks
* or simply a check for containing {@link #CGLIB_CLASS_SEPARATOR}
*/
@Deprecated
@Deprecated(since = "5.2")
public static boolean isCglibProxyClass(@Nullable Class<?> clazz) {
return (clazz != null && isCglibProxyClassName(clazz.getName()));
}
@@ -966,7 +966,7 @@ public abstract class ClassUtils {
* @deprecated as of 5.2, in favor of custom (possibly narrower) checks
* or simply a check for containing {@link #CGLIB_CLASS_SEPARATOR}
*/
@Deprecated
@Deprecated(since = "5.2")
public static boolean isCglibProxyClassName(@Nullable String className) {
return (className != null && className.contains(CGLIB_CLASS_SEPARATOR));
}
@@ -1388,7 +1388,7 @@ public abstract class ClassUtils {
* @see #getPubliclyAccessibleMethodIfPossible(Method, Class)
* @deprecated in favor of {@link #getInterfaceMethodIfPossible(Method, Class)}
*/
@Deprecated
@Deprecated(since = "5.2")
public static Method getInterfaceMethodIfPossible(Method method) {
return getInterfaceMethodIfPossible(method, null);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 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.
@@ -72,7 +72,7 @@ public abstract class SerializationUtils {
* <p>Prefer the use of an external tool (that serializes to JSON, XML, or
* any other format) which is regularly checked and updated for not allowing RCE.
*/
@Deprecated
@Deprecated(since = "6.0")
public static @Nullable Object deserialize(byte @Nullable [] bytes) {
if (bytes == null) {
return null;

View File

@@ -108,7 +108,7 @@ public abstract class StringUtils {
* @deprecated as of 5.3, in favor of {@link #hasLength(String)} and
* {@link #hasText(String)} (or {@link ObjectUtils#isEmpty(Object)})
*/
@Deprecated
@Deprecated(since = "5.3")
public static boolean isEmpty(@Nullable Object str) {
return (str == null || "".equals(str));
}