commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Steelman" <>
Subject RE: [Digester] enums in ConvertUtils.register
Date Wed, 15 Jun 2005 12:27:41 GMT
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?


-----Original Message-----
From: Simon Kitching [] 
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.



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

View raw message