Browse Source

regular IndexOutOfBoundsException if index beyond auto-grow limit

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4654 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/merge
Juergen Hoeller 15 years ago
parent
commit
9be513d225
  1. 8
      org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java

8
org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java

@ -990,10 +990,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra @@ -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 @@ -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