Consider hierarchy when searching for @Validated

Update `ConfigurationPropertiesBindingPostProcessor` to use a more
exhaustive hierarchy search when checking for `@Validated`.

Fixes gh-8150
This commit is contained in:
Phillip Webb
2017-01-31 17:09:02 -08:00
parent 21234b36de
commit 4fa38aeba4

View File

@@ -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")) {