From fae14b409f04ea5aaa8942739341f2364c3906e8 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Thu, 10 Dec 2015 16:04:31 +0000 Subject: [PATCH] Check that we own the validator before nulling it out See gh-4734 --- .../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 b3efdaa69a0..72339f9da67 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 @@ -205,7 +205,7 @@ public class ConfigurationPropertiesBindingPostProcessor @Override public void onApplicationEvent(ContextRefreshedEvent event) { - if (this.validator != null && isJsr303Present()) { + if (this.ownedValidator && this.validator != null && isJsr303Present()) { this.validator = null; // allow it to be garbage collected } }