regular IndexOutOfBoundsException if index beyond auto-grow limit

master
Juergen Hoeller 13 years ago
parent b9fe1b3250
commit b8f7d324af
  1. 8
      org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java

@ -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);

Loading…
Cancel
Save