Skip to content

Configuration class parsing registers bean in parent class if overridden @Bean method defines an alternative name #28286

Closed
@mpiela

Description

We are experiencing a difference in behaviour when setting up a spring context in junit tests.
Here is a simple project that shows the difference: https://github.com/mpiela/spring-ctx-bug.
Usage:

mvn test

There are two tests in there:

The issue seems to be with an overriden @Bean method in a @Configuration class and omitting the bean name in the subclass.

Both of these tests pass on Spring 5.2.8. When we switched to Spring 5.2.9 the one with the xml configuration file starts failing.

I am not really sure if this is a bug that's been fixed in 5.2.8 and 5.2.9 is the expected behaviour or if it is the other way around.

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions