[concurrency-interest] Re: AtomicInteger and AtomicLong should implement Number

Dawid Kurzyniec dawidk@mathcs.emory.edu
Wed, 14 Jan 2004 12:37:12 -0500

> -----Original Message-----
> From: concurrency-interest-admin@cs.oswego.edu 
> [mailto:concurrency-interest-admin@cs.oswego.edu] On Behalf 
> Of Curt Cox
> Sent: Wednesday, January 14, 2004 11:30 AM
> To: concurrency-interest@altair.cs.oswego.edu
> Subject: RE: [concurrency-interest] Re: AtomicInteger and 
> AtomicLong should implement Number

> I'm a believer in declaring 
> classes final, unless they were designed with extension in mind.

I agree with Curt on that :)

I believe that the atomics should be kept final. Otherwise, it may
preclude or make it more difficult for JIT to perform some optimizations
(inline-out memory allocation and/or method calls). This is crucial for
low-level algorithms, for which these classes are primarily provided.

Occasional suicidal users can still craft enough rope by using
delegation (everybody can extend Number) and/or write custom external