Björn Eickvonder wrote:
I use a LazyList within a bean to store indexed properties, having only a "getList()" and a "setList(list)" method. This works fine as long as I only set nested properties of the indexed property, i.e. setting something like list[0].attribute. But if I try to set the indexed property itself by e.g. "PropertyUtils.setProperty(bean, "list[0]", "val0")" out of the beanutils package I get an ArrayIndexOutOfBounds because in the end this call uses the set-method of the underlying list. So my suggestion would be to slightly extend the LazyList by overwriting the set-method (defined in List) in the following waypublic Object set(int index, Object obj) { if (index>=size()) get(index); return super.set(index, obj); } What do you think about this idea?
See GrowthList in SVN which grows on set() and add(). To achieve a list that grows on set(), add() and get() you must use both a Lazylist and a GrowthList together.
Stephen --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
