This is an optimization that recognizes the need for Hibernate
validator to cache reflection data, but also that we don't need it
after the bulk of the work has been done on context refresh.
Fixes gh-4734
@ -87,7 +90,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
@@ -87,7 +90,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
privatePropertySourcespropertySources;
privateValidatorvalidator;
privatevolatileValidatorvalidator;
privatebooleanownedValidator=false;
@ -192,6 +195,22 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
@@ -192,6 +195,22 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
@ -200,11 +219,6 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
@@ -200,11 +219,6 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
@ -219,7 +233,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
@@ -219,7 +233,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
@Override
publicvoiddestroy()throwsException{
if(this.ownedValidator){
if(this.ownedValidator&&this.validator!=null){
((DisposableBean)this.validator).destroy();
}
}
@ -339,6 +353,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
@@ -339,6 +353,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
@ -116,6 +118,16 @@ public class ConfigurationPropertiesBindingPostProcessorTests {
@@ -116,6 +118,16 @@ public class ConfigurationPropertiesBindingPostProcessorTests {