japitools-list
[Top][All Lists]
Advanced

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

Re: [Japi] Abstract enums


From: Stuart Ballard
Subject: Re: [Japi] Abstract enums
Date: Tue, 28 Nov 2006 08:49:39 -0500

On 11/28/06, Jeroen Frijters <address@hidden> wrote:
Where are you seeing this? I can't reproduce this with the versions of
javac and ecj I have installed (both mark the class as abstract).

Well, according to Japize, TimeUnit is not abstract in JDK1.5. I was
assuming that JDK1.5 was using the same JSR166 sources that Classpath
is, but perhaps that's not the case. In fact now that you mentioned
this I looked at the jdk6 results and it does appear that TimeUnit
*is* abstract in jdk6. So presumably the sources Classpath is using
are newer than 1.5. Sorry for the confusion.

Agreed. BTW, doesn't this also mean that you should ignore "abstract" on
methods in an enum? After all, aren't these two enums the same:

Yes, good point. And (as would generally be the case for a final
class) treat all methods as final too.

As an interesting aside, the VM does not actually prevent you from
subclassing an enum with a regular class. This means that coupled with
the "finalizer attack" you can actually create illegal enum values. This
was fixed in 1.6 by adding a final finalize method to java.lang.Enum.

You mean that an enum has a non-private constructor? Why?

Or am I misunderstanding the "finalizer attack" and it doesn't
actually require one?

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




reply via email to

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