regular IndexOutOfBoundsException if index beyond auto-grow limit

This commit is contained in:
Juergen Hoeller 2011-07-03 20:12:18 +00:00
parent b9fe1b3250
commit b8f7d324af
1 changed files with 4 additions and 4 deletions

View File

@ -990,10 +990,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
oldValue = list.get(index);
}
Object convertedValue = convertIfNecessary(propertyName, oldValue, pv.getValue(), requiredType, TypeDescriptor.nested(property(pd), tokens.keys.length));
if (index < size) {
list.set(index, convertedValue);
}
else if (index >= size && index < this.autoGrowCollectionLimit) {
if (index >= size && index < this.autoGrowCollectionLimit) {
for (int i = size; i < index; i++) {
try {
list.add(null);
@ -1007,6 +1004,9 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
}
list.add(convertedValue);
}
else {
list.set(index, convertedValue);
}
}
else if (propValue instanceof Map) {
PropertyDescriptor pd = getCachedIntrospectionResults().getPropertyDescriptor(actualName);