Polishing

This commit is contained in:
Juergen Hoeller
2019-03-26 16:13:51 +01:00
parent 210b178922
commit 635305647c
6 changed files with 78 additions and 116 deletions

View File

@@ -668,12 +668,14 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
@Nullable
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType)
throws NoSuchBeanDefinitionException {
return findMergedAnnotationOnBean(beanName, annotationType).synthesize(
MergedAnnotation::isPresent).orElse(null);
return findMergedAnnotationOnBean(beanName, annotationType)
.synthesize(MergedAnnotation::isPresent).orElse(null);
}
private <A extends Annotation> MergedAnnotation<A> findMergedAnnotationOnBean(
String beanName, Class<A> annotationType) {
Class<?> beanType = getType(beanName);
if (beanType != null) {
MergedAnnotation<A> annotation = MergedAnnotations.from(beanType,