JavaMemoryModel: Re: Are this$x fields final?

From: Sylvia Else (
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.


JavaMemoryModel mailing list -

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