commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [digester] - v1.4 breaks existing code : property has no gett er method
Date Tue, 04 Feb 2003 23:25:02 GMT
i've confirmed this behaviour and it looks like a bug to me. i'm not sure 
the best way to fix it as yet.

- robert

On Monday, February 3, 2003, at 11:53 PM, Baltz, Kenneth wrote:

> Looks like you have it right.  Here's the code from the fix:
>
> 	// Force an exception if the property does not exist
> 	// (BeanUtils.setProperty() sildently returns in this case)
> 	PropertyUtils.getProperty(top, actualName);
>
> 	// Set the property (with conversion as necessary)
> 	BeanUtils.setProperty(top, actualName, actualValue);
>
> I'm sure it fails in PropertyUtils.getProperty for your code.
>
> It looks like the problem is ultimately with BeanUtils.setProperty.  
> Maybe a
> bug should be filed against BeanUtils?  I guess it depends on the design
> intent of Digester (i.e. is it intended for Beans only).
>
> K.C.
>
>> -----Original Message-----
>> From: Simon Kitching [mailto:simon@ecnetwork.co.nz]
>> Sent: Monday, February 03, 2003 3:36 PM
>> To: commons-user@jakarta.apache.org
>> Subject: [digester] - v1.4 breaks existing code : property
>> has no getter
>> method
>>
>>
>> Hi,
>>
>> I have just downloaded release 1.4 of digester & given it a spin.
>>
>> My existing code now fails with the following exception:
>>
>> ERROR: org.apache.commons.digester.Digester: 2003-02-04 11:08:52,011
>> [main] (Digester.java:1066) - End event threw exception
>> java.lang.NoSuchMethodException: Property 'identifier' has no getter
>> method
>>
>> Is this related to the fix for bug 16233, "Invalid bean setters do not
>> generate an exception"?
>>
>> I believe the error message is referring to the fact that I
>> have classes
>> instantiated/populated via digester rules which have setter methods
>> without getter methods (eg setIdentifier without getIdentifier in this
>> case). The attributes being set are only accessed by the class
>> concerned, and therefore it makes no sense for these to have getter
>> methods. I understand that this might be a violation of the
>> "java bean"
>> rules, but I don't believe that digester is intended to populate only
>> beans.
>>
>> I agree with the original bug that a rule which explicitly
>> tries to set
>> a nonexistent property should report an error; I am hoping the above
>> problem is an accidental side-effect of the fix for this.
>>
>> Any comments?
>>
>> Regards,
>>
>> Simon
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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