Regression in duplicate beans with @Primary
in 6.2.0
#33920
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
Observed Issue
In Spring Boot 3.3, duplicate named beans can be defined where
@Primary
can be used as the default. In Spring Boot 3.4 RC1, this behavior is no longer the same.Consider the following example of two named beans with different behavior.
When validated in the following test, SB 3.3 expectedly injects the "truthful" bean version marked as
@Primary
.When this same test is applied in Spring Boot 3.4 RC1, the
@Primary
"foo" bean is no longer created, causing this test evaluation to fail.Is this an exepected change in behavior?
Reproducer
This test is available here
The text was updated successfully, but these errors were encountered: