Merge branch '1.5.x'
This commit is contained in:
commit
66f9696a44
|
|
@ -85,10 +85,13 @@ public class AnnotationsPropertySource extends EnumerablePropertySource<Class<?>
|
||||||
|
|
||||||
private List<Annotation> getMergedAnnotations(Class<?> root, Class<?> source) {
|
private List<Annotation> getMergedAnnotations(Class<?> root, Class<?> source) {
|
||||||
List<Annotation> mergedAnnotations = new ArrayList<>();
|
List<Annotation> mergedAnnotations = new ArrayList<>();
|
||||||
for (Annotation annotation : AnnotationUtils.getAnnotations(source)) {
|
Annotation[] annotations = AnnotationUtils.getAnnotations(source);
|
||||||
if (!AnnotationUtils.isInJavaLangAnnotationPackage(annotation)) {
|
if (annotations != null) {
|
||||||
mergedAnnotations
|
for (Annotation annotation : annotations) {
|
||||||
.add(findMergedAnnotation(root, annotation.annotationType()));
|
if (!AnnotationUtils.isInJavaLangAnnotationPackage(annotation)) {
|
||||||
|
mergedAnnotations
|
||||||
|
.add(findMergedAnnotation(root, annotation.annotationType()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mergedAnnotations;
|
return mergedAnnotations;
|
||||||
|
|
|
||||||
|
|
@ -79,12 +79,15 @@ class PropertyMappingContextCustomizer implements ContextCustomizer {
|
||||||
Set<Class<?>> components = new LinkedHashSet<>();
|
Set<Class<?>> components = new LinkedHashSet<>();
|
||||||
Set<Class<?>> propertyMappings = new LinkedHashSet<>();
|
Set<Class<?>> propertyMappings = new LinkedHashSet<>();
|
||||||
while (beanClass != null) {
|
while (beanClass != null) {
|
||||||
for (Annotation annotation : AnnotationUtils.getAnnotations(beanClass)) {
|
Annotation[] annotations = AnnotationUtils.getAnnotations(beanClass);
|
||||||
if (isAnnotated(annotation, Component.class)) {
|
if (annotations != null) {
|
||||||
components.add(annotation.annotationType());
|
for (Annotation annotation : annotations) {
|
||||||
}
|
if (isAnnotated(annotation, Component.class)) {
|
||||||
if (isAnnotated(annotation, PropertyMapping.class)) {
|
components.add(annotation.annotationType());
|
||||||
propertyMappings.add(annotation.annotationType());
|
}
|
||||||
|
if (isAnnotated(annotation, PropertyMapping.class)) {
|
||||||
|
propertyMappings.add(annotation.annotationType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
beanClass = beanClass.getSuperclass();
|
beanClass = beanClass.getSuperclass();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue