# Deprecated API

## Contents

- Terminally Deprecated
- Classes
- Fields
- Methods
- Constructors

Terminally Deprecated Elements
Element
Description
org.springframework.beans.factory.aot.BeanInstanceSupplier.withGenerator(ThrowingSupplier<T>)
in favor of `BeanInstanceSupplier.withGenerator(ThrowingFunction)`
org.springframework.beans.factory.aot.BeanInstanceSupplier.withShortcuts(String...)
in favor of `BeanInstanceSupplier.withShortcut(String...)`
org.springframework.beans.factory.support.SimpleInstantiationStrategy.setCurrentlyInvokedFactoryMethod(Method)
in favor of `SimpleInstantiationStrategy.instantiateWithFactoryMethod(Method, Supplier)`

Deprecated Classes
Class
Description
org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer
as of 5.2, along with `PropertyPlaceholderConfigurer`
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
as of 5.2; use `org.springframework.context.support.PropertySourcesPlaceholderConfigurer` instead which is more flexible through taking advantage of the `Environment` and `PropertySource` mechanisms.
org.springframework.beans.factory.support.PropertiesBeanDefinitionReader
as of 5.3, in favor of Spring's common bean definition formats and/or custom reader implementations

Deprecated Fields
Field
Description
org.springframework.beans.factory.config.AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT
as of Spring 3.0: If you are using mixed autowiring strategies, prefer annotation-based autowiring for clearer demarcation of autowiring needs.
org.springframework.beans.factory.support.AbstractBeanDefinition.AUTOWIRE_AUTODETECT
as of Spring 3.0: If you are using mixed autowiring strategies, use annotation-based autowiring for clearer demarcation of autowiring needs.

Deprecated Methods
Method
Description
org.springframework.beans.BeanUtils.instantiate(Class<T>)
as of Spring 5.0, following the deprecation of `Class.newInstance()` in JDK 9
org.springframework.beans.factory.aot.BeanInstanceSupplier.withGenerator(ThrowingSupplier<T>)
in favor of `BeanInstanceSupplier.withGenerator(ThrowingFunction)`
org.springframework.beans.factory.aot.BeanInstanceSupplier.withShortcuts(String...)
in favor of `BeanInstanceSupplier.withShortcut(String...)`
org.springframework.beans.factory.aot.InstanceSupplierCodeGenerator.generateCode(RegisteredBean, Executable)
in favor of `InstanceSupplierCodeGenerator.generateCode(RegisteredBean, InstantiationDescriptor)`
org.springframework.beans.factory.config.AutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(Object, String)
as of 6.1, in favor of implicit post-processing through `AutowireCapableBeanFactory.initializeBean(Object, String)`
org.springframework.beans.factory.config.AutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(Object, String)
as of 6.1, in favor of implicit post-processing through `AutowireCapableBeanFactory.initializeBean(Object, String)`
org.springframework.beans.factory.config.AutowireCapableBeanFactory.createBean(Class<?>, int, boolean)
as of 6.1, in favor of `AutowireCapableBeanFactory.createBean(Class)`
org.springframework.beans.factory.config.SingletonBeanRegistry.getSingletonMutex()
as of 6.2, in favor of lenient singleton locking (with this method returning an arbitrary object to lock on)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(Object, String)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(Object, String)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Class<?>, int, boolean)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingletonMutex()
org.springframework.beans.factory.support.RegisteredBean.resolveConstructorOrFactoryMethod()
in favor of `RegisteredBean.resolveInstantiationDescriptor()`
org.springframework.beans.factory.support.SimpleInstantiationStrategy.setCurrentlyInvokedFactoryMethod(Method)
in favor of `SimpleInstantiationStrategy.instantiateWithFactoryMethod(Method, Supplier)`

Deprecated Constructors
Constructor
Description
org.springframework.beans.factory.support.RootBeanDefinition(ResolvableType)
as of 6.0.11, in favor of an extra `RootBeanDefinition.setTargetType(ResolvableType)` call