Description
When using PropertyResolver.getValue("myList[1]", myBean), the PropertyResolver$ListGetSet.getValue() (line 762) unconditionally does:
return ((List)object).get(index);
which throws an java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 if the backing list contains only one element (at index 0).
Shouldn't the implementation rather return null like with every other property not found? Like when using "bla.bli.blo" as a lookup string and there is no bla field and no getBla() method?
So this method should rather be:
org.apache.wicket.util.lang.PropertyResolver$ListGetSet.getValue():
/**
- @see org.apache.wicket.util.lang.PropertyResolver.IGetAndSet#getValue(java.lang.Object)
*/
public Object getValue(Object object)Unknown macro: { List list = (List) object; if (index >= list.size()) { return null; } return list.get(index); }