From 4fa38aeba48a4f6641e48b3f73e1bc0c55c18156 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 31 Jan 2017 17:09:02 -0800 Subject: [PATCH] Consider hierarchy when searching for @Validated Update `ConfigurationPropertiesBindingPostProcessor` to use a more exhaustive hierarchy search when checking for `@Validated`. Fixes gh-8150 --- .../properties/ConfigurationPropertiesBindingPostProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java index 0ac9ce4f24..2d22769c42 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java @@ -417,7 +417,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc if (!super.supports(type)) { return false; } - if (AnnotatedElementUtils.isAnnotated(type, Validated.class)) { + if (AnnotatedElementUtils.hasAnnotation(type, Validated.class)) { return true; } if (type.getPackage().getName().startsWith("org.springframework.boot")) {