commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@blueyonder.co.uk>
Subject Re: [BeanUtils] Handling array creation?
Date Thu, 08 Sep 2005 21:08:01 GMT
Ahh my mistake, I used the LazyDynaBean code for most of what I posted and
assumed PropertyUtils.getPropertyType() returned the type for the property
(array) rather than the arrays components. I find PropertyUtils behaving
that way surprising and non-intuitve.

Niall

----- Original Message ----- 
From: "Frank W. Zammetti" <fzlists@omnytex.com>
Sent: Thursday, September 08, 2005 8:44 PM


> I believe I found the problem... it looks like the line:
>
> Class componentType = type.getComponentType();
>
> ...is superfluous because the value that is needed is gotten by the call
> to PropertyUtils.getPropertyType().
>
> What I'm seeing is that PropertyUtils.getPropertyType() returns "class
> java.lang.String", which is exactly what I expect.  If I then call
> isArray() on that returned Class object, if comes up false.  Then, trying
> to call getComponentType() on that Class returns null, which breaks
> everything after it.  So, just taking that line out seems to make it work
> as expected.



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message