Right, indirect subclassing of java.lang.Enum is not allowed so any enum is an end-of-the-line, but I'll triple check that with the spec. I'll explore the listed issues fully, see if I can come up with any others, provide some unit testing (is JUnit the preferred way?), and create a bugzilla enhancement entry. How's that for service? ;-) As this is my first week using Digester & BeanUtils, where would this code go between Digester & BeanUtils and with what class?
Thanks, Jon -----Original Message----- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 15, 2005 4:59 AM To: Jakarta Commons Users List Subject: RE: [Digester] enums in ConvertUtils.register On Wed, 2005-06-15 at 04:30 -0400, Jon Steelman wrote: > I wrote the following code that works on jdk1.5 *and* I expect to be > backwards compatible to jdk1.1: That was quick! This looks reasonable to me. The reflection is of course slow, but for non-enum targets, the cost is fairly low. Could you create a bugzilla enhancement entry for this? I will then try to commit it within the next few days. There are a few issues that need to be addressed, though: * Is clazz always going to be a direct subclass of java.lang.Enum? I don't think you can subclass enums, but haven't looked into this. And what about when the enum is in a nested class, etc? * Need to handle the error cases better. As you say, these should never occur - but never is a dangerous word in the software world :) Actually - can an enum be private? What happens in that case? I guess I need to learn more about java1.5 enums! Thanks very much for the patch. Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
