spring-framework/framework-docs
Sam Brannen d79258ac73 Reject non-singletons in Test Bean Override support
Prior to this commit, a non-singleton FactoryBean was silently replaced
by a singleton bean. In addition, bean definitions for prototype-scoped
and custom-scoped beans were replaced by singleton bean definitions
that were incapable of creating the desired bean instance. For example,
if the bean type of the original bean definition was a concrete class,
an attempt was made to invoke the default constructor which either
succeeded with undesirable results or failed with an exception if the
bean type did not have a default constructor. If the bean type of the
original bean definition was an interface or a FactoryBean that claimed
to create a bean of a certain interface type, an attempt was made to
instantiate the interface which always failed with a
BeanCreationException.

To address the aforementioned issues, this commit reworks the logic in
BeanOverrideBeanFactoryPostProcessor so that an exception is thrown
whenever an attempt is made to override a non-singleton bean.

Closes gh-33602
2024-09-29 18:12:00 +02:00
..
modules/ROOT Reject non-singletons in Test Bean Override support 2024-09-29 18:12:00 +02:00
src Merge branch '6.1.x' 2024-09-11 17:17:38 +02:00
antora-playbook.yml Build documentation branches only for 6.1 and later 2024-08-16 17:04:55 +02:00
antora.yml Merge branch '6.1.x' 2024-09-16 16:59:31 +02:00
framework-docs.gradle Merge branch '6.1.x' 2024-07-26 10:05:06 +02:00
package.json Modernize Antora Build 2024-05-22 10:20:20 +02:00