properly wrap IndexOutOfBoundsException even for List

This commit is contained in:
Juergen Hoeller
2011-07-03 20:24:12 +00:00
parent b8f7d324af
commit 22939b6d05
2 changed files with 13 additions and 7 deletions

View File

@@ -1005,7 +1005,13 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
list.add(convertedValue);
}
else {
list.set(index, convertedValue);
try {
list.set(index, convertedValue);
}
catch (IndexOutOfBoundsException ex) {
throw new InvalidPropertyException(getRootClass(), this.nestedPath + propertyName,
"Invalid list index in property path '" + propertyName + "'", ex);
}
}
}
else if (propValue instanceof Map) {