Re: JavaMemoryModel: Motivation and Semantics for Immutable objects

From: David Holmes (
Date: Mon Aug 06 2001 - 17:32:15 EDT


I too am a little confused about how to get an immutable object. Based on
what you say then to get an Immutable String either:

a) All fields of String must be final; or
b) All references to String objects must be final

I don't see how we can mandate a) given the implementation of class String.

If we require b) to get Immutable Strings then we must change all the
security sensitive uses of Strings in the class libraries to use final
references - assuming that is even possible. (I'm assuming that failing to
use a final reference in your own code will simply cause a local problem and
not compromise security.)

Could you clarify the situation please.


JavaMemoryModel mailing list -

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