From 652906ec7c65de01c7d782c693d118b86dc2c4eb Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Wed, 8 May 2019 21:27:11 +0900 Subject: [PATCH] Use MergedAnnotation.getRoot() in PropertyMappingCheckBeanPostProcessor Closes gh-16745 --- .../properties/PropertyMappingContextCustomizer.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMappingContextCustomizer.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMappingContextCustomizer.java index fdc8eebb49..15fe712402 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMappingContextCustomizer.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMappingContextCustomizer.java @@ -93,10 +93,7 @@ class PropertyMappingContextCustomizer implements ContextCustomizer { } private Class getRoot(MergedAnnotation annotation) { - while (annotation.getParent() != null) { - annotation = annotation.getParent(); - } - return annotation.getType(); + return annotation.getRoot().getType(); } private String getAnnotationsDescription(Set> annotations) {