That makes sense, thanks Thomas. I now have to go off and do the code that will handle unknown property types (as Niall demonstrated), and I don't think I can do that with PropertyUtils (as I did in the test case where I know the type). I'll see if there is another way to do this because I should get bit by this (likely) bug again in that case. I'll also see about putting together a patch and ticket for this issue, assuming someone reading this doesn't point out how you (and now I since I agree!) are mistaken :)
-- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, September 8, 2005 3:53 pm, Thomas Dudziak said: > On 9/8/05, Frank W. Zammetti <[EMAIL PROTECTED]> 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. > > Tom > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
