JavaMemoryModel: Re: Are this$x fields final?

From: Sylvia Else (syljmm32@cryogenic.net)
Date: Wed May 26 2004 - 01:48:23 EDT


Unless I've misunderstood it, ConcurrentHashMap from JSR166 is an example
of real life code that can fail if the reference to the outer class is not
final. Consider in particular the keySet() method, which potentially (and
intentionally, for sure) returns an instance of an inner class via a data
race. The inner class refers to its outer class in some of its methods.

Sylvia.

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



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