Expose autoGrowCollectionLimit in ConfigurablePropertyAccessor interface

See gh-36862
This commit is contained in:
Juergen Hoeller
2026-06-02 17:20:52 +02:00
parent 481a5743b3
commit e6ce2a3c36
5 changed files with 36 additions and 26 deletions
@@ -273,8 +273,9 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
* Specify the limit for array and collection auto-growing.
* <p>Default is 256, preventing OutOfMemoryErrors in case of large indexes.
* Raise this limit if your auto-growing needs are unusually high.
* <p>Used for setter/field injection via {@link #bind(PropertyValues)}, and not
* applicable to constructor binding via {@link #construct}.
* <p>Used for setter injection - and as of 7.1 also for field injection -
* via {@link #bind(PropertyValues)}; not applicable to constructor binding
* via {@link #construct}.
* @see #initBeanPropertyAccess()
* @see org.springframework.beans.BeanWrapper#setAutoGrowCollectionLimit
*/
@@ -19,7 +19,6 @@ package org.springframework.validation;
import org.jspecify.annotations.Nullable;
import org.springframework.beans.ConfigurablePropertyAccessor;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.PropertyAccessorFactory;
/**
@@ -100,7 +99,7 @@ public class DirectFieldBindingResult extends AbstractPropertyBindingResult {
this.directFieldAccessor = createDirectFieldAccessor();
this.directFieldAccessor.setExtractOldValueForEditor(true);
this.directFieldAccessor.setAutoGrowNestedPaths(this.autoGrowNestedPaths);
((DirectFieldAccessor) this.directFieldAccessor).setAutoGrowCollectionLimit(this.autoGrowCollectionLimit);
this.directFieldAccessor.setAutoGrowCollectionLimit(this.autoGrowCollectionLimit);
}
return this.directFieldAccessor;
}