From 2f88dd735edc3c87113c4b54eeabb7599565fb49 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 3 Jul 2019 15:52:46 -0700 Subject: [PATCH] Polish --- .../bind/validation/ValidationBindHandler.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandler.java index a78b51704d..73064e04d4 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandler.java @@ -65,13 +65,6 @@ public class ValidationBindHandler extends AbstractBindHandler { return super.onSuccess(name, target, context, result); } - @Override - public void onFinish(ConfigurationPropertyName name, Bindable target, BindContext context, Object result) - throws Exception { - validate(name, target, context, result); - super.onFinish(name, target, context, result); - } - @Override public Object onFailure(ConfigurationPropertyName name, Bindable target, BindContext context, Exception error) throws Exception { @@ -83,6 +76,13 @@ public class ValidationBindHandler extends AbstractBindHandler { return result; } + @Override + public void onFinish(ConfigurationPropertyName name, Bindable target, BindContext context, Object result) + throws Exception { + validate(name, target, context, result); + super.onFinish(name, target, context, result); + } + private void validate(ConfigurationPropertyName name, Bindable target, BindContext context, Object result) { Object validationTarget = getValidationTarget(target, context, result); Class validationType = target.getBoxedType().resolve();