mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Avoid NPE in PropertyMappingContextCustomizer
See gh-9914
This commit is contained in:
parent
3cc22ecffb
commit
e7a6b8c260
@ -79,12 +79,15 @@ class PropertyMappingContextCustomizer implements ContextCustomizer {
|
|||||||
Set<Class<?>> components = new LinkedHashSet<Class<?>>();
|
Set<Class<?>> components = new LinkedHashSet<Class<?>>();
|
||||||
Set<Class<?>> propertyMappings = new LinkedHashSet<Class<?>>();
|
Set<Class<?>> propertyMappings = new LinkedHashSet<Class<?>>();
|
||||||
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
Block a user