Merge branch '5.1.x'

This commit is contained in:
Juergen Hoeller
2019-04-03 14:43:22 +02:00
3 changed files with 5 additions and 9 deletions

View File

@@ -243,7 +243,7 @@ public interface ListableBeanFactory extends BeanFactory {
throws BeansException;
/**
* Find all names of beans whose {@code Class} has the supplied {@link Annotation}
* Find all names of beans which are annotated with the supplied {@link Annotation}
* type, without creating corresponding bean instances yet.
* <p>Note that this method considers objects created by FactoryBeans, which means
* that FactoryBeans will get initialized in order to determine their object type.
@@ -256,7 +256,7 @@ public interface ListableBeanFactory extends BeanFactory {
String[] getBeanNamesForAnnotation(Class<? extends Annotation> annotationType);
/**
* Find all beans whose {@code Class} has the supplied {@link Annotation} type,
* Find all beans which are annotated with the supplied {@link Annotation} type,
* returning a Map of bean names with corresponding bean instances.
* <p>Note that this method considers objects created by FactoryBeans, which means
* that FactoryBeans will get initialized in order to determine their object type.

View File

@@ -658,12 +658,6 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
return result;
}
/**
* Find a {@link Annotation} of {@code annotationType} on the specified
* bean, traversing its interfaces and super classes if no annotation can be
* found on the given class itself, as well as checking its raw bean class
* if not found on the exposed bean reference (e.g. in case of a proxy).
*/
@Override
@Nullable
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType)
@@ -686,6 +680,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()) {
Class<?> beanClass = bd.getBeanClass();
if (beanClass != beanType) {
@@ -696,6 +691,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
}
}
}
// Check annotations declared on factory method, if any.
Method factoryMethod = bd.getResolvedFactoryMethod();
if (factoryMethod != null) {
MergedAnnotation<A> annotation =

View File

@@ -433,7 +433,7 @@ public @interface Configuration {
* is registered as a traditional XML bean definition, the name/id of the bean
* element will take precedence.
* @return the explicit component name, if any (or empty String otherwise)
* @see org.springframework.beans.factory.support.DefaultBeanNameGenerator
* @see AnnotationBeanNameGenerator
*/
@AliasFor(annotation = Component.class)
String value() default "";