Details
Description
When using a PropertyModel with a list as target and an index ("[0]") as property the PropertyModel cannot retreive the object from the list. When getObject() is called a IndexOutOfBoundsException is thrown.
Example:
List addresses = new List();
new PropertyModel(addresses, "[0]");
model.getObject();
Exception:
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(String.java:687)
at org.apache.wicket.util.lang.PropertyResolver.findGetter(PropertyResolver.java:509)
at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:338)
at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:224)
at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91)
at org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)
I have attached a QuickStart (with 2 test; 1 with the current PropertyResolver and 1 with the patched PropertyResolver) and a patch file.