Re: JavaMemoryModel: Corner cases for final fields

From: forwarding from Joshua Bloch (pugh@cs.umd.edu)
Date: Tue Sep 12 2000 - 16:25:06 EDT


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

Bill,

     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.

                  Josh
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



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