DataBinder applies its autoGrowCollectionLimit to bean-property binding, but direct-field binding does not apply the same limit to the underlying DirectFieldAccessor.
With the default limit of 256, binding items[255].name succeeds for both bean-property binding and direct-field binding, as expected.
Binding items[256].name is rejected for bean-property binding, but succeeds after calling initDirectFieldAccess().
Reproducer:
https://github.com/mkurz/spring-direct-field-autogrow-repro
Expected behavior:
Direct-field binding should reject items[256].name the same way bean-property binding does.
Actual behavior:
Direct-field binding grows the collection past the configured limit.
DataBinderapplies itsautoGrowCollectionLimitto bean-property binding, but direct-field binding does not apply the same limit to the underlyingDirectFieldAccessor.With the default limit of
256, bindingitems[255].namesucceeds for both bean-property binding and direct-field binding, as expected.Binding
items[256].nameis rejected for bean-property binding, but succeeds after callinginitDirectFieldAccess().Reproducer:
https://github.com/mkurz/spring-direct-field-autogrow-repro
Expected behavior:
Direct-field binding should reject
items[256].namethe same way bean-property binding does.Actual behavior:
Direct-field binding grows the collection past the configured limit.