Skip to content

Add missing since attributes for @Deprecated declarations #34942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public abstract class BeanUtils {
* @deprecated as of Spring 5.0, following the deprecation of
* {@link Class#newInstance()} in JDK 9
*/
@Deprecated
@Deprecated(since = "5.0")
public static <T> T instantiate(Class<T> clazz) throws BeanInstantiationException {
Assert.notNull(clazz, "Class must not be null");
if (clazz.isInterface()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -100,7 +100,7 @@ public interface AutowireCapableBeanFactory extends BeanFactory {
* @deprecated as of Spring 3.0: If you are using mixed autowiring strategies,
* prefer annotation-based autowiring for clearer demarcation of autowiring needs.
*/
@Deprecated
@Deprecated(since = "3.0")
int AUTOWIRE_AUTODETECT = 4;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public Object configureBean(Object existingBean, String beanName) throws BeansEx
// Specialized methods for fine-grained control over the bean lifecycle
//-------------------------------------------------------------------------

@Deprecated
@Deprecated(since = "6.1")
@Override
public Object createBean(Class<?> beanClass, int autowireMode, boolean dependencyCheck) throws BeansException {
// Use non-singleton bean definition, to avoid registering bean as dependent bean.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -98,7 +98,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* @deprecated as of Spring 3.0: If you are using mixed autowiring strategies,
* use annotation-based autowiring for clearer demarcation of autowiring needs.
*/
@Deprecated
@Deprecated(since = "3.0")
public static final int AUTOWIRE_AUTODETECT = AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
* @deprecated as of 5.3, in favor of Spring's common bean definition formats
* and/or custom reader implementations
*/
@Deprecated
@Deprecated(since = "5.3")
public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -158,7 +158,7 @@ public void setFallbackToSystemLocale(boolean fallbackToSystemLocale) {
* @since 4.3
* @deprecated as of 5.2.2, in favor of {@link #getDefaultLocale()}
*/
@Deprecated
@Deprecated(since = "5.2.2")
protected boolean isFallbackToSystemLocale() {
return this.fallbackToSystemLocale;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ protected void processProperties(ConfigurableListableBeanFactory beanFactoryToPr
* {@link #processProperties(ConfigurableListableBeanFactory, ConfigurablePropertyResolver)}
*/
@Override
@Deprecated
@Deprecated(since = "3.1")
protected void processProperties(ConfigurableListableBeanFactory beanFactory, Properties props) {
throw new UnsupportedOperationException(
"Call processProperties(ConfigurableListableBeanFactory, ConfigurablePropertyResolver) instead");
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -153,7 +153,7 @@ public void execute(Runnable task) {
this.adaptedExecutor.execute(task);
}

@Deprecated
@Deprecated(since = "5.3.16")
@Override
public void execute(Runnable task, long startTimeout) {
this.adaptedExecutor.execute(task, startTimeout);
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -302,7 +302,7 @@ public int getActiveCount() {
* @deprecated as of 5.3.9, in favor of direct
* {@link #getScheduledThreadPoolExecutor()} access
*/
@Deprecated
@Deprecated(since = "5.3.9")
public boolean isRemoveOnCancelPolicy() {
if (this.scheduledExecutor == null) {
// Not initialized yet: return our setting for the time being.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private 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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public int getParameterIndex() {
* @see #getNestingLevel()
* @deprecated since 5.2 in favor of {@link #nested(Integer)}
*/
@Deprecated
@Deprecated(since = "5.2")
public void increaseNestingLevel() {
this.nestingLevel++;
}
Expand All @@ -277,7 +277,7 @@ public void increaseNestingLevel() {
* @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--;
Expand Down Expand Up @@ -309,7 +309,7 @@ public MethodParameter withTypeIndex(int typeIndex) {
* @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);
}
Expand Down Expand Up @@ -429,7 +429,7 @@ public MethodParameter withContainingClass(@Nullable Class<?> containingClass) {
/**
* 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;
Expand All @@ -449,7 +449,7 @@ public Class<?> getContainingClass() {
/**
* Set a resolved (generic) parameter type.
*/
@Deprecated
@Deprecated(since = "5.2")
void setParameterType(@Nullable Class<?> parameterType) {
this.parameterType = parameterType;
}
Expand Down Expand Up @@ -760,7 +760,7 @@ public MethodParameter clone() {
* @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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -79,7 +79,7 @@ public String toString() {
* 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private static <A extends Annotation> boolean isSingleLevelPresent(MergedAnnotat
* @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);
Expand All @@ -289,7 +289,7 @@ private static <A extends Annotation> boolean isSingleLevelPresent(MergedAnnotat
* @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);
Expand Down Expand Up @@ -328,7 +328,7 @@ private static <A extends Annotation> boolean isSingleLevelPresent(MergedAnnotat
* @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) {

Expand Down Expand Up @@ -365,7 +365,7 @@ public static <A extends Annotation> Set<A> getRepeatableAnnotations(AnnotatedEl
* @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) {

Expand Down Expand Up @@ -409,7 +409,7 @@ public static <A extends Annotation> Set<A> getRepeatableAnnotations(AnnotatedEl
* @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) {

Expand Down Expand Up @@ -446,7 +446,7 @@ public static <A extends Annotation> Set<A> getDeclaredRepeatableAnnotations(Ann
* @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) {

Expand Down Expand Up @@ -597,7 +597,7 @@ public static <A extends Annotation> Set<A> getDeclaredRepeatableAnnotations(Ann
* @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) {

Expand Down Expand Up @@ -633,7 +633,7 @@ public static <A extends Annotation> Set<A> getDeclaredRepeatableAnnotations(Ann
* @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) {

Expand Down Expand Up @@ -686,7 +686,7 @@ public static boolean isAnnotationDeclaredLocally(Class<? extends Annotation> an
* @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)
Expand All @@ -704,7 +704,7 @@ public static boolean isAnnotationInherited(Class<? extends Annotation> annotati
* @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) {

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -100,7 +100,7 @@ public Mono<T> decodeToMono(Publisher<DataBuffer> input, ResolvableType elementT
* @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) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public void setDefaultProfiles(String... profiles) {
}

@Override
@Deprecated
@Deprecated(since = "5.1")
public boolean acceptsProfiles(String... profiles) {
Assert.notEmpty(profiles, "Must specify at least one profile");
for (String profile : profiles) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -133,7 +133,7 @@ default boolean matchesProfiles(String... profileExpressions) {
* @deprecated as of 5.1 in favor of {@link #acceptsProfiles(Profiles)} or
* {@link #matchesProfiles(String...)}
*/
@Deprecated
@Deprecated(since = "5.1")
boolean acceptsProfiles(String... profiles);

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;


Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public void execute(Runnable task) {
* @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");
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -25,7 +25,7 @@
* @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 {

Expand Down
Loading