From: "Will Pugh" <[EMAIL PROTECTED]>
> 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).
More than troubling. A class with these methods is not compliant with the
JavaBeans specification, so BeanUtils can't be expected to work right.
This will be seen as two separate properties. The Callback[] pair is fine.
The other pair of methods, taken by themselves, aren't valid due to the
'int' parameter in the 'get' method.
Do you have any control over this code? IMO it needs to be changed to
four methods with the same property name and the proper signatures for an
indexed property:
>From Section 7.2 of the JavaBeans 1.01 Specification:
For indexed properties the accessor type signatures are:
void setter(int index, PropertyType value); // indexed setter
PropertyType getter(int index); // indexed getter
void setter(PropertyType values[]); // array setter
PropertyType[] getter(); // array getter
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]