Re: JavaMemoryModel: Corner cases for final fields

From: forwarding from Joshua Bloch (
Date: Tue Sep 12 2000 - 16:25:06 EDT

[The following message from Josh bounced because Josh apparently sent
it from an address <> different than the one
he is subscribed at <> -- I'll try to catch these,
but if you have switched your standard email address, please update
the majordomo]


     My feeling is that it isn't worth the effort to allow escapes. The idiom
proposed by Jan-Willem seems far more natural. If you need a static factory in
lieu of a constructor anyway, you might as well do it right. That said,
there's plenty of code in existence that "registers" an object inside a static
data structure as part of construction. I'm pretty sure that the Java platform
libraries contain such code. I'm afraid that such code is just broken.

JavaMemoryModel mailing list -

This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:27 EDT