mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
properly wrap IndexOutOfBoundsException even for List
This commit is contained in:
+7
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user