Improve toString()
for AbstractBeanDefinition
and BeanMetadataAttribute
#33579
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
To improve diagnostics, we should improve the String representations of bean definitions and bean metadata attributes.
The
toString()
implementation ofAbstractBeanDefinition
currently includes the bean class name in bracketsclass [...]
; whereas, everything else is not in brackets and just uses an equals sign -- for example,scope=singleton
.With modern Spring applications that make heavy use of
@Bean
methods in@Configuration
classes, bean definitions do not have a pre-configured bean class name. Thus, it makes sense to align the formatting of the bean class name with the formatting of other properties -- for example,class=...
.With the recent introduction of
@Fallback
support, it would also be good to include thefallback
flag intoString()
alongside theprimary
flag.The String representation of a
BeanMetadataAttribute
could also be improved to include thevalue
in addition to thename
.The text was updated successfully, but these errors were encountered: