japitools-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Japi] Abstract enums


From: Stuart Ballard
Subject: [Japi] Abstract enums
Date: Mon, 27 Nov 2006 13:39:46 -0500

I discovered today what appears to be a compiler difference in the way
certain enums are handled. The enum TimeUnit has an abstract method
that is implemented in each of the individual enum values. It appears
that ecj is emitting the enum type itself as abstract for this case,
while the RI's TimeUnit enum is not abstract.

This may or may not be a compiler bug in either javac or ecj, but it
does seem clear that it's not a bug in TimeUnit itself. I can't see
any possible practical problem for any user of the TimeUnit enum from
the fact that it's been compiled as abstract or not, since it's never
instantiated directly anyway.

So I think I'm going to modify Japize to treat all enums as
non-abstract regardless of what their modifiers say - and while I'm at
it also treat them all as final. I'm not exactly asking for votes on
this, because I'm fairly sure it's the right thing to do; but I'm
sending this mail to offer people the opportunity to give objections
before I go ahead and do it :)

Stuart.

--
http://sab39.netreach.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]