-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
To improve diagnostics, we should improve the String representations of bean definitions and bean metadata attributes.
The toString() implementation of AbstractBeanDefinition currently includes the bean class name in brackets class [...]; 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 the fallback flag in toString() alongside the primary flag.
The String representation of a BeanMetadataAttribute could also be improved to include the value in addition to the name.