@Configuration enhancer does not throw proper exception in case of mismatched @Bean method [SPR-12905] #17504
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Christopher Smith opened SPR-12905 and commented
Given two unrelated
@Configuration
classes, one of which (FooConfiguration
) provides@Bean Foo fooBean()
and the other which (BarConfiguration
) provides@Bean Bar fooBean()
and has another bean method that callsfooBean()
, the CGLib enhancer will fill in theFoo fooBean
from the first configuration, causing aClassCastException
trying to castFoo
toBar
. This is something of a bug on the user's side for having a name collision, but if the container can't handle duplicate names, it needs to report that error explicitly.Affects: 4.1.6
Referenced from: commits e403aef, aa49949
The text was updated successfully, but these errors were encountered: