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

Loading…
Cancel
Save