findAnnotationOnBean only falls back to bean class in case of no factory method
Most importantly, static @Bean methods do not expose their @Configuration class-level annotations anymore, aligned with the behavior for non-static @Bean methods. Closes gh-28298
This commit is contained in:
@@ -745,7 +745,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
||||
if (containsBeanDefinition(beanName)) {
|
||||
RootBeanDefinition bd = getMergedLocalBeanDefinition(beanName);
|
||||
// Check raw bean class, e.g. in case of a proxy.
|
||||
if (bd.hasBeanClass()) {
|
||||
if (bd.hasBeanClass() && bd.getFactoryMethodName() == null) {
|
||||
Class<?> beanClass = bd.getBeanClass();
|
||||
if (beanClass != beanType) {
|
||||
MergedAnnotation<A> annotation =
|
||||
|
||||
Reference in New Issue
Block a user