- 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:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 3:36 PM To: [EMAIL PROTECTED] Subject: [digester] - v1.4 breaks existing code : property has no getter methodHi, 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]