commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Pugh <>
Subject Should PropertyUtilsBean catch NoSuchMethodException?
Date Fri, 17 Jun 2005 18:21:44 GMT

I ran into a problem when using CGLib and Beanutils.  The gist seems to 
be CGLib adds a number of getters and setters, but in particularly, it adds

       Callback[]  getCallbacks()
       void           setCallbacks(Callback[])
       Callback    getCallback(int)
       void           setCallback(Callback)

It seems a little troubling that they dropped the "s" in the singular 
case (since they end up working with the same properties anyways).  
However, I now get a wacky problem in that BeanUtils.copyProperties() 
now works as I would expect, but BeanUtils.clone() does not work.

This discreperency seems to be that one calls 
BeanUtilsBean.copyProperties and the other calls 

It would appear that both implementations of copyProperty have the 
problem where they use isReadable to determine if they can read a 
property, but use getSimpleProperty to get the property.  The problem 
here is that isReadable returns true even if the property is an indexed 
property, however, in such a case getSimpleProperty throws an exception.

BeanUtilsBean.copyProperties catches this exception.  
PropertyUtilsBean.copyProperties does not.  Is there a reason for this 
discreperency?  Also, as a side note, why are there two copyProperties 
methods?  What are supposed to be the differences between the two?


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

View raw message