Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The getHelper() method publishes the mutable helper field. Because the Helper class is immutable, it cannot be changed after it is initialized.

. Furthermore, because Helper is immutable, it is always constructed properly before its reference is made visible, in compliance with TSM03-J. Do not publish partially initialized objects. Unfortunately, a separate thread could observe a stale reference in the helper field of the Foo class.

...