JavaMemoryModel: Code in the JDK that fails under current memory model

From: Bill Pugh (
Date: Mon Jul 12 1999 - 14:40:54 EDT

Has anyone put together a list of places
in the JDK that assume initialization safety?

Here are some I've found:

There are synchronized setFoo and matching unsynchronized getFoo
methods, operating on references, in:

java/awt/CheckboxGroup.set/get Current
java/awt/Component.set/get Cursor
java/awt/Dialog.set/get Title
java/awt/FileDialog.set/get FilenameFilter
java/awt/FocusManager.set/get FocusOwner
java/awt/Frame.set/get Title
java/awt/Frame.set/get IconImage
java/awt/MenuItem.set/get Label
java/lang/System.set/get SecurityManager
java/security/SecureRandom.set/get Seed
java/sql/DriverManager.set/get LogWriter
java/sql/DriverManager.set/get LogStream
java/sql/SQLException.set/get NextException
java/util/Locale.set/get Default
java/util/Properties.set/get Property
sun/net/www/MimeEntry.set/get ImageFileName

The double check idiom is used in:


Using AssureJ, I found that the race for the set/get Cursor
in java.awt.Component does occur in practice.

        Bill Pugh
This is the JavaMemoryModel mailing list, managed by Majordomo 1.94.4.

To send a message to the list, email
To send a request to the list, email and put
your request in the body of the message (use the request "help" for help).
For more information, visit

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