From 58eccfe5bdab21212c19f39a1ab635a0e5f541d6 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 14 Dec 2016 22:00:05 +0100 Subject: [PATCH] Remove setExtractOldValueForEditor at DataBinder level (to be deprecated in 4.3.5) Issue: SPR-15009 --- .../validation/DataBinder.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/validation/DataBinder.java b/spring-context/src/main/java/org/springframework/validation/DataBinder.java index cbdbc679fb..3ab1cf202e 100644 --- a/spring-context/src/main/java/org/springframework/validation/DataBinder.java +++ b/spring-context/src/main/java/org/springframework/validation/DataBinder.java @@ -144,14 +144,14 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter { private String[] requiredFields; - private BindingErrorProcessor bindingErrorProcessor = new DefaultBindingErrorProcessor(); - - private final List validators = new ArrayList<>(); - private ConversionService conversionService; private MessageCodesResolver messageCodesResolver; + private BindingErrorProcessor bindingErrorProcessor = new DefaultBindingErrorProcessor(); + + private final List validators = new ArrayList<>(); + /** * Create a new DataBinder instance, with default object name. @@ -252,12 +252,14 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter { protected AbstractPropertyBindingResult createBeanPropertyBindingResult() { BeanPropertyBindingResult result = new BeanPropertyBindingResult(getTarget(), getObjectName(), isAutoGrowNestedPaths(), getAutoGrowCollectionLimit()); + if (this.conversionService != null) { result.initConversion(this.conversionService); } if (this.messageCodesResolver != null) { result.setMessageCodesResolver(this.messageCodesResolver); } + return result; } @@ -476,16 +478,6 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter { return this.requiredFields; } - /** - * Set whether to extract the old field value when applying a - * property editor to a new value for a field. - *

Default is "true", exposing previous field values to custom editors. - * Turn this to "false" to avoid side effects caused by getters. - */ - public void setExtractOldValueForEditor(boolean extractOldValueForEditor) { - getPropertyAccessor().setExtractOldValueForEditor(extractOldValueForEditor); - } - /** * Set the strategy to use for resolving errors into message codes. * Applies the given strategy to the underlying errors holder.