RE: JavaMemoryModel: Qualified this is final?

From: David Holmes (
Date: Sat Apr 17 2004 - 08:22:31 EDT

Sylvia Else wrote:
> An instance of a non-static inner class has an implied reference
> to another instance, and this reference is used when fields of
> the other instance are accessed. The reference can also be
> accessed directly means of a qualified this expression of the
> form classname.this.
> Is this reference considered to be final by the memory model, in
> that it is included in the freeze that occurs at the end of a constructor?
> If not, should it be?

Rather than the JMM treating this reference specially, it should suffice
that the JLS define that such a reference is final. It seems javac already
does this:

private final Outer this$0;

but I couldn't find anything in JLS 2nd Edition that addressed it.

David Holmes

JavaMemoryModel mailing list -

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