Top For Removal Deprecated
Spring Core 6.1.4

Deprecated API


Terminally Deprecated Item Summary

SinceTerminally Deprecated Item and Description
6.0.12
org.springframework.aot.hint.support.FilePatternResourceHintsRegistrar.FilePatternResourceHintsRegistrar(List<String>
the file prefixes
filePrefixes
,
List<String>
the classpath locations
classpathLocations
,
List<String>
the file extensions (starting with a dot)
fileExtensions
)

as of 6.0.12 in favor of the builder

6.0.12
6.0.5
org.springframework.util.Base64Utils

as of Spring Framework 6.0.5 in favor of Base64; scheduled for removal in 6.2

6.0
org.springframework.util.MimeType.SpecificityComparator<
the type of mime types that may be compared by this comparator
T extends MimeType
>

As of 6.0, with no direct replacement

6.0

Deprecated Item Summary

SinceDeprecated Item and Description
org.springframework.asm.ClassReader.b

Use readByte(int) and the other read methods instead. This field will eventually be deleted.

Returns:

the index of a new or already existing method type reference item.
org.springframework.asm.ClassWriter.newHandle
(final int tag, final String
the internal name of the field or method owner class (see Type#getInternalName()).
owner
,
final String
the name of the field or method.
name
,
final String
the descriptor of the field or method.
descriptor
)

this method is superseded by newHandle(int, String, String, String, boolean).

org.springframework.asm.Handle.Handle(final int tag, final String
the internal name of the class that owns the field or method designated by this handle (see Type#getInternalName()).
owner
,
final String
the name of the field or method designated by this handle.
name
,
final String
the descriptor of the field or method designated by this handle.
descriptor
)

this constructor has been superseded by Handle(int, String, String, String, boolean).

org.springframework.asm.MethodVisitor.visitMethodInsn(final int
the opcode of the type instruction to be visited. This opcode is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.
opcode
,
final String
the internal name of the method's owner class (see Type#getInternalName()).
owner
,
final String
the method's name.
name
,
final String
the method's descriptor (see Type).
descriptor
)

use visitMethodInsn(int, String, String, String, boolean) instead.

org.springframework.cglib.core.KeyFactory.OBJECT_BY_CLASS

this customizer might result in unexpected class leak since key object still holds a strong reference to the Object and class. It is recommended to have pre-processing method that would strip Objects and represent Classes as Strings

6.1
org.springframework.core.Constants

since 6.1 with no replacement; use an enum, map, or similar custom solution instead

Returns:

the corresponding generic parameter or return type
org.springframework.core.GenericTypeResolver.resolveParameterType
(MethodParameter
the method parameter specification
methodParameter
,
Class<?>
the class to resolve type variables against
implementationClass
)

since 5.2 in favor of methodParameter.withContainingClass(implementationClass).getParameterType()

org.springframework.core.MethodParameter.decreaseNestingLevel()

since 5.2 in favor of retaining the original MethodParameter and using nested(Integer) if nesting is required

Returns:

the corresponding MethodParameter instance
org.springframework.core.MethodParameter.forMethodOrConstructor
(Object
the Method or Constructor to specify a parameter for
methodOrConstructor
,
int
the index of the parameter
parameterIndex
)

as of 5.0, in favor of forExecutable

org.springframework.core.MethodParameter.setTypeIndexForCurrentLevel(int
the corresponding type index (or null for the default type index)
typeIndex
)

since 5.2 in favor of withTypeIndex

6.0

Returns:

the full exception message
org.springframework.core.NestedExceptionUtils.buildMessage
(String
the base message
message
,
Throwable
the root cause
cause
)

as of 6.0, in favor of custom exception messages with selective inclusion of cause messages

org.springframework.core.annotation.AnnotationFilter.NONE

as of 5.2.6 since the MergedAnnotations model always ignores lang annotations according to the PLAIN filter (for efficiency reasons)

Returns:

the first Class in the inheritance hierarchy that declares an annotation of the specified annotationType, or null if not found
org.springframework.core.annotation.AnnotationUtils.findAnnotationDeclaringClass
(Class<? extends Annotation>
the annotation type to look for
annotationType
,
Class<?>
the class to check for the annotation on (may be null)
clazz
)

as of 5.2 since it is superseded by the MergedAnnotations API

Returns:

the first Class in the inheritance hierarchy that declares an annotation of at least one of the specified annotationTypes, or null if not found
org.springframework.core.annotation.AnnotationUtils.findAnnotationDeclaringClassForTypes
(List<Class<? extends Annotation>>
the annotation types to look for
annotationTypes
,
Class<?>
the class to check for the annotation on (may be null)
clazz
)

as of 5.2 since it is superseded by the MergedAnnotations API

Returns:

the annotations found, an empty array, or null if not resolvable (e.g. because nested Class values in annotation attributes failed to resolve at runtime)
org.springframework.core.annotation.AnnotationUtils.getAnnotations
(AnnotatedElement
the Method, Constructor or Field to retrieve annotations from
annotatedElement
)

as of 5.2 since it is superseded by the MergedAnnotations API

Returns:

the annotations found, an empty array, or null if not resolvable (e.g. because nested Class values in annotation attributes failed to resolve at runtime)
org.springframework.core.annotation.AnnotationUtils.getAnnotations
(Method
the Method to retrieve annotations from
method
)

as of 5.2 since it is superseded by the MergedAnnotations API

Returns:

the annotations found or an empty set (never null)
org.springframework.core.annotation.AnnotationUtils.getDeclaredRepeatableAnnotations
(AnnotatedElement
the element to look for annotations on
annotatedElement
,
Class<A>
the annotation type to look for
annotationType
)

as of 5.2 since it is superseded by the MergedAnnotations API

Returns:

the annotations found or an empty set (never null)
org.springframework.core.annotation.AnnotationUtils.getDeclaredRepeatableAnnotations
(AnnotatedElement
the element to look for annotations on
annotatedElement
,
Class<A>
the annotation type to look for
annotationType
,
Class<? extends Annotation>
the type of the container that holds the annotations; may be null if a container is not supported or if it should be looked up via @java.lang.annotation.Repeatable when running on Java 8 or higher
containerAnnotationType
)

as of 5.2 since it is superseded by the MergedAnnotations API

Returns:

the annotations found or an empty set (never null)
org.springframework.core.annotation.AnnotationUtils.getRepeatableAnnotations
(AnnotatedElement
the element to look for annotations on
annotatedElement
,
Class<A>
the annotation type to look for
annotationType
)

as of 5.2 since it is superseded by the MergedAnnotations API

Returns:

the annotations found or an empty set (never null)
org.springframework.core.annotation.AnnotationUtils.getRepeatableAnnotations
(AnnotatedElement
the element to look for annotations on
annotatedElement
,
Class<A>
the annotation type to look for
annotationType
,
Class<? extends Annotation>
the type of the container that holds the annotations; may be null if a container is not supported or if it should be looked up via @java.lang.annotation.Repeatable when running on Java 8 or higher
containerAnnotationType
)

as of 5.2 since it is superseded by the MergedAnnotations API

Returns:

true if an annotation of the specified annotationType is present and inherited
org.springframework.core.annotation.AnnotationUtils.isAnnotationInherited
(Class<? extends Annotation>
the annotation type to look for
annotationType
,
Class<?>
the class to check for the annotation on
clazz
)

as of 5.2 since it is superseded by the MergedAnnotations API

Returns:

true if such an annotation is meta-present
org.springframework.core.annotation.AnnotationUtils.isAnnotationMetaPresent
(Class<? extends Annotation>
the annotation type to search on
annotationType
,
Class<? extends Annotation>
the type of meta-annotation to search for
metaAnnotationType
)

as of 5.2 since it is superseded by the MergedAnnotations API

6.1
org.springframework.core.env.JOptCommandLinePropertySource

since 6.1 with no plans for a replacement

6.0
6.0

Returns:

this data buffer as a byte buffer
org.springframework.core.io.buffer.DataBuffer.asByteBuffer
(int
the index at which to start the byte buffer
index
,
int
the length of the returned byte buffer
length
)

as of 6.0, in favor of toByteBuffer(int, ByteBuffer, int, int), readableByteBuffers(), or writableByteBuffers().

6.0

Returns:

this buffer
org.springframework.core.io.buffer.DataBuffer.capacity
(int
the new capacity
capacity
)

as of 6.0, in favor of ensureWritable(int), which has different semantics

6.0

Returns:

this buffer
org.springframework.core.io.buffer.DataBuffer.ensureCapacity
(int
the writable capacity to check for
capacity
)

since 6.0, in favor of ensureWritable(int)

6.0

Returns:

the specified, retained slice of this data buffer
org.springframework.core.io.buffer.DataBuffer.retainedSlice
(int
the index at which to start the slice
index
,
int
the length of the slice
length
)

as of 6.0, in favor of split(int), which has different semantics

6.0

Returns:

the specified slice of this data buffer
org.springframework.core.io.buffer.DataBuffer.slice
(int
the index at which to start the slice
index
,
int
the length of the slice
length
)

as of 6.0, in favor of split(int), which has different semantics

6.0.5

Returns:

this data buffer as a byte buffer
org.springframework.core.io.buffer.DataBuffer.toByteBuffer
()

as of 6.0.5, in favor of toByteBuffer(ByteBuffer)

6.0.5

Returns:

this data buffer as a byte buffer
org.springframework.core.io.buffer.DataBuffer.toByteBuffer
(int index, int length)

as of 6.0.5, in favor of toByteBuffer(int, ByteBuffer, int, int)

6.0
org.springframework.core.io.buffer.DataBufferWrapper.asByteBuffer(int
the index at which to start the byte buffer
index
,
int
the length of the returned byte buffer
length
)

org.springframework.core.io.buffer.DataBufferWrapper.ensureCapacity(int
the writable capacity to check for
capacity
)

org.springframework.core.io.buffer.DataBufferWrapper.retainedSlice(int
the index at which to start the slice
index
,
int
the length of the slice
length
)

org.springframework.core.io.buffer.DataBufferWrapper.slice(int
the index at which to start the slice
index
,
int
the length of the slice
length
)

org.springframework.core.io.buffer.DefaultDataBuffer.asByteBuffer(int
the index at which to start the byte buffer
index
,
int
the length of the returned byte buffer
length
)

org.springframework.core.io.buffer.DefaultDataBuffer.slice(int
the index at which to start the slice
index
,
int
the length of the slice
length
)

org.springframework.core.io.buffer.Netty5DataBuffer.asByteBuffer(int
the index at which to start the byte buffer
index
,
int
the length of the returned byte buffer
length
)

org.springframework.core.io.buffer.Netty5DataBuffer.slice(int
the index at which to start the slice
index
,
int
the length of the slice
length
)

org.springframework.core.io.buffer.NettyDataBuffer.asByteBuffer(int
the index at which to start the byte buffer
index
,
int
the length of the returned byte buffer
length
)

org.springframework.core.io.buffer.NettyDataBuffer.retainedSlice(int
the index at which to start the slice
index
,
int
the length of the slice
length
)

org.springframework.core.io.buffer.NettyDataBuffer.slice(int
the index at which to start the slice
index
,
int
the length of the slice
length
)

6.0
org.springframework.core.io.support.SpringFactoriesLoader.loadFactoryNames(Class<?>
the interface or abstract class representing the factory
factoryType
,
ClassLoader
the ClassLoader to use for loading resources; can be null to use the default
classLoader
)

as of 6.0 in favor of load(Class, ArgumentResolver, FailureHandler)

6.0

Returns:

a ListenableFuture representing pending completion of the task
org.springframework.core.task.AsyncListenableTaskExecutor.submitListenable
(Runnable
the Runnable to execute (never null)
task
)

in favor of AsyncTaskExecutor#submitCompletable(Runnable)

Returns:

a ListenableFuture representing pending completion of the task
org.springframework.core.task.AsyncListenableTaskExecutor.submitListenable
(Callable<T>
the Callable to execute (never null)
task
)

in favor of AsyncTaskExecutor#submitCompletable(Callable)

org.springframework.core.task.AsyncTaskExecutor.execute(Runnable
the Runnable to execute (never null)
task
,
long
the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are TIMEOUT_IMMEDIATE or TIMEOUT_INDEFINITE (the default as used by execute(Runnable)).
startTimeout
)

as of 5.3.16 since the common executors do not support start timeouts

org.springframework.core.task.SimpleAsyncTaskExecutor.execute(Runnable
the Runnable to execute (never null)
task
,
long
the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are TIMEOUT_IMMEDIATE or TIMEOUT_INDEFINITE (the default as used by execute(Runnable)).
startTimeout
)

org.springframework.core.task.SimpleAsyncTaskExecutor.submitListenable(Runnable
the Runnable to execute (never null)
task
)

Deprecated as a consequence of ListenableFuture being deprecated. See corresponding docs for further information.

org.springframework.core.task.SimpleAsyncTaskExecutor.submitListenable(Callable<T>
the Callable to execute (never null)
task
)

Deprecated as a consequence of ListenableFuture being deprecated. See corresponding docs for further information.

org.springframework.core.task.TaskTimeoutException

as of 5.3.16 since the common executors do not support start timeouts

org.springframework.core.task.support.TaskExecutorAdapter.submitListenable(Runnable
the Runnable to execute (never null)
task
)

Deprecated as a consequence of ListenableFuture being deprecated. See corresponding docs for further information.

org.springframework.core.task.support.TaskExecutorAdapter.submitListenable(Callable<T>
the Callable to execute (never null)
task
)

Deprecated as a consequence of ListenableFuture being deprecated. See corresponding docs for further information.

org.springframework.core.type.StandardAnnotationMetadata.StandardAnnotationMetadata(Class<?>
the Class to introspect
introspectedClass
)

since 5.2 in favor of the factory method AnnotationMetadata#introspect(Class)

org.springframework.core.type.StandardAnnotationMetadata.StandardAnnotationMetadata(Class<?>
the Class to introspect
introspectedClass
,
boolean
return nested annotations and annotation arrays as org.springframework.core.annotation.AnnotationAttributes for compatibility with ASM-based AnnotationMetadata implementations
nestedAnnotationsAsMap
)

since 5.2 in favor of the factory method AnnotationMetadata#introspect(Class). Use MergedAnnotation.asMap from getAnnotations() rather than getAnnotationAttributes(String) if nestedAnnotationsAsMap is false

org.springframework.core.type.StandardMethodMetadata.StandardMethodMetadata(Method
the Method to introspect
introspectedMethod
)

since 5.2 in favor of obtaining instances via AnnotationMetadata

Returns:

the corresponding interface method, or the original method if none found
org.springframework.util.ClassUtils.getInterfaceMethodIfPossible
(Method
the method to be invoked, potentially from an implementation class
method
)

in favor of getInterfaceMethodIfPossible(Method, Class)

org.springframework.util.ClassUtils.isCglibProxy(Object
the object to check
object
)

as of 5.2, in favor of custom (possibly narrower) checks such as for a Spring AOP proxy

org.springframework.util.ClassUtils.isCglibProxyClass(Class<?>
the class to check
clazz
)

as of 5.2, in favor of custom (possibly narrower) checks or simply a check for containing CGLIB_CLASS_SEPARATOR

org.springframework.util.ClassUtils.isCglibProxyClassName(String
the class name to check
className
)

as of 5.2, in favor of custom (possibly narrower) checks or simply a check for containing CGLIB_CLASS_SEPARATOR

6.0
6.1
6.1
6.1
6.1
6.1
6.1
6.1
6.1
6.1

Returns:

the result of deserializing the bytes
org.springframework.util.SerializationUtils.deserialize
(byte[]
a serialized object
bytes
)

This utility uses Java Object Serialization, which allows arbitrary code to be run and is known for being the source of many Remote Code Execution (RCE) vulnerabilities.

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.

6.1
6.1
6.1
6.1
6.0

Returns:

an InputStream which contains no bytes
org.springframework.util.StreamUtils.emptyInput
()

as of 6.0 in favor of InputStream#nullInputStream()

org.springframework.util.StringUtils.isEmpty(Object
the candidate object (possibly a String)
str
)

as of 5.3, in favor of hasLength(String) and hasText(String) (or ObjectUtils#isEmpty(Object))

6.0

Returns:

the trimmed String
org.springframework.util.StringUtils.trimLeadingWhitespace
(String
the String to check
str
)

since 6.0, in favor of String#stripLeading()

6.0

Returns:

the trimmed String
org.springframework.util.StringUtils.trimTrailingWhitespace
(String
the String to check
str
)

since 6.0, in favor of String#stripTrailing()

6.0

Returns:

the trimmed String
org.springframework.util.StringUtils.trimWhitespace
(String
the String to check
str
)

since 6.0, in favor of String#strip()

6.1
org.springframework.util.comparator.ComparableComparator<
the type of comparable objects that may be compared by this comparator
T extends Comparable<T>
>

as of 6.1 in favor of Comparator#naturalOrder()

org.springframework.util.comparator.ComparableComparator.INSTANCE

Deprecated as a consequence of ComparableComparator being deprecated. See corresponding docs for further information.

6.1
org.springframework.util.comparator.NullSafeComparator<
the type of objects that may be compared by this comparator
T
>

as of 6.1 in favor of Comparator#nullsLast and Comparator#nullsFirst

org.springframework.util.comparator.NullSafeComparator.NULLS_HIGH

Deprecated as a consequence of NullSafeComparator being deprecated. See corresponding docs for further information.

org.springframework.util.comparator.NullSafeComparator.NULLS_LOW

Deprecated as a consequence of NullSafeComparator being deprecated. See corresponding docs for further information.

6.0
org.springframework.util.concurrent.CompletableToListenableFutureAdapter<
the result type returned by this Future's get method
T
>

as of 6.0, with no concrete replacement

org.springframework.util.concurrent.CompletableToListenableFutureAdapter.addCallback(ListenableFutureCallback<? super T>
the callback to register
callback
)

Deprecated as a consequence of ListenableFutureCallback being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.CompletableToListenableFutureAdapter.addCallback(SuccessCallback<? super T>
the success callback
successCallback
,
FailureCallback
the failure callback
failureCallback
)

Deprecated as a consequence of SuccessCallback and FailureCallback being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.CompletableToListenableFutureAdapter.callbacks

Deprecated as a consequence of ListenableFutureCallbackRegistry being deprecated. See corresponding docs for further information.

6.0
6.0
org.springframework.util.concurrent.FutureAdapter<
the type of this Future
T
,
the type of the adaptee's Future
S
>

as of 6.0, with no concrete replacement

6.0
org.springframework.util.concurrent.ListenableFuture<
the result type returned by this Future's get method
T
>

as of 6.0, in favor of CompletableFuture

6.0
6.0
org.springframework.util.concurrent.ListenableFuture.addCallback(SuccessCallback<? super T>
the success callback
successCallback
,
FailureCallback
the failure callback
failureCallback
)

as of 6.0, in favor of CompletableFuture#whenComplete(BiConsumer)

6.0
org.springframework.util.concurrent.ListenableFutureAdapter<
the type of this Future
T
,
the type of the adaptee's Future
S
>

as of 6.0, in favor of java.util.concurrent.CompletableFuture

org.springframework.util.concurrent.ListenableFutureAdapter.ListenableFutureAdapter(ListenableFuture<S>
the future to adapt to
adaptee
)

Deprecated as a consequence of ListenableFuture being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.ListenableFutureAdapter.addCallback(final ListenableFutureCallback<? super T>
the callback to register
callback
)

Deprecated as a consequence of ListenableFutureCallback being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.ListenableFutureAdapter.addCallback(final SuccessCallback<? super T>
the success callback
successCallback
,
final FailureCallback
the failure callback
failureCallback
)

Deprecated as a consequence of SuccessCallback and FailureCallback being deprecated. See corresponding docs for further information.

6.0
6.0
org.springframework.util.concurrent.ListenableFutureCallbackRegistry<
the callback result type
T
>

as of 6.0, with no concrete replacement

org.springframework.util.concurrent.ListenableFutureCallbackRegistry.addCallback(ListenableFutureCallback<? super T>
the callback to add
callback
)

Deprecated as a consequence of ListenableFutureCallback being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.ListenableFutureCallbackRegistry.addFailureCallback(FailureCallback
the failure callback to add
callback
)

Deprecated as a consequence of FailureCallback being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.ListenableFutureCallbackRegistry.addSuccessCallback(SuccessCallback<? super T>
the success callback to add
callback
)

Deprecated as a consequence of SuccessCallback being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.ListenableFutureCallbackRegistry.notifyFailure(FailureCallback callback)

Deprecated as a consequence of FailureCallback being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.ListenableFutureCallbackRegistry.notifySuccess(SuccessCallback<? super T> callback)

Deprecated as a consequence of SuccessCallback being deprecated. See corresponding docs for further information.

6.0
org.springframework.util.concurrent.ListenableFutureTask<
the result type returned by this Future's get method
T
>

as of 6.0, with no concrete replacement

org.springframework.util.concurrent.ListenableFutureTask.addCallback(ListenableFutureCallback<? super T>
the callback to register
callback
)

Deprecated as a consequence of ListenableFutureCallback being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.ListenableFutureTask.addCallback(SuccessCallback<? super T>
the success callback
successCallback
,
FailureCallback
the failure callback
failureCallback
)

Deprecated as a consequence of SuccessCallback and FailureCallback being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.ListenableFutureTask.callbacks

Deprecated as a consequence of ListenableFutureCallbackRegistry being deprecated. See corresponding docs for further information.

6.0
6.0
org.springframework.util.concurrent.SettableListenableFuture<
the result type returned by this Future's get method
T
>

as of 6.0, in favor of CompletableFuture

org.springframework.util.concurrent.SettableListenableFuture.SettableTask<T>

Deprecated as a consequence of ListenableFutureTask being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.SettableListenableFuture.addCallback(ListenableFutureCallback<? super T>
the callback to register
callback
)

Deprecated as a consequence of ListenableFutureCallback being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.SettableListenableFuture.addCallback(SuccessCallback<? super T>
the success callback
successCallback
,
FailureCallback
the failure callback
failureCallback
)

Deprecated as a consequence of SuccessCallback and FailureCallback being deprecated. See corresponding docs for further information.

org.springframework.util.concurrent.SettableListenableFuture.settableTask

Deprecated as a consequence of SettableListenableFuture.SettableTask being deprecated. See corresponding docs for further information.

6.0