Commit e7a6b8c2 authored by Dennis Kieselhorst's avatar Dennis Kieselhorst Committed by Andy Wilkinson

Avoid NPE in PropertyMappingContextCustomizer

See gh-9914
parent 3cc22ecf
......@@ -79,12 +79,15 @@ class PropertyMappingContextCustomizer implements ContextCustomizer {
Set<Class<?>> components = new LinkedHashSet<Class<?>>();
Set<Class<?>> propertyMappings = new LinkedHashSet<Class<?>>();
while (beanClass != null) {
for (Annotation annotation : AnnotationUtils.getAnnotations(beanClass)) {
if (isAnnotated(annotation, Component.class)) {
components.add(annotation.annotationType());
}
if (isAnnotated(annotation, PropertyMapping.class)) {
propertyMappings.add(annotation.annotationType());
Annotation[] annotations = AnnotationUtils.getAnnotations(beanClass);
if (annotations != null) {
for (Annotation annotation : annotations) {
if (isAnnotated(annotation, Component.class)) {
components.add(annotation.annotationType());
}
if (isAnnotated(annotation, PropertyMapping.class)) {
propertyMappings.add(annotation.annotationType());
}
}
}
beanClass = beanClass.getSuperclass();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment