restored DataBinder's ability to bind to an auto-growing List with unknown element type (SPR-8828)

This commit is contained in:
Juergen Hoeller
2011-12-07 21:25:54 +00:00
parent b9868a498e
commit 8213d0cb50
2 changed files with 112 additions and 2 deletions

View File

@@ -977,13 +977,13 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
pd.getReadMethod(), tokens.keys.length);
List list = (List) propValue;
int index = Integer.parseInt(key);
int size = list.size();
Object oldValue = null;
if (isExtractOldValueForEditor() && index < size) {
if (isExtractOldValueForEditor() && index < list.size()) {
oldValue = list.get(index);
}
Object convertedValue = convertIfNecessary(propertyName, oldValue, pv.getValue(), requiredType,
new PropertyTypeDescriptor(pd, new MethodParameter(pd.getReadMethod(), -1), requiredType));
int size = list.size();
if (index >= size && index < this.autoGrowCollectionLimit) {
for (int i = size; i < index; i++) {
try {