commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <>
Subject Re: [BeanUtils] Handling array creation?
Date Thu, 08 Sep 2005 19:53:17 GMT
On 9/8/05, Frank W. Zammetti <> wrote:
> > The problem is the indexed setter, it confuses the BeanUtils class,
> > probably because it (in contrast to PropertyUtils) tries to convert
> > the value to the type expected by the setter method. Since you know
> > the target type already, you could use PropertyUtils instead.
> Could you explain how it "confuses" it?  Is it maybe just a matter of not
> having both setters (that doesn't seem right to me, but who knows??  I
> don't!)  In reality I won't always know the type of the array being set,
> it's only in this specific test case that I do, hence the reason Niall
> provided the code like this.

This may very well be a bug in beanutils (I havn't checked the bug
list), but from what I can see in the source of beanutils, the
PropertyUtilsBean invokes the direct setter method (without index)
with a single string instead of an String[] array, hence the argument
type mismatch.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message