Versions Compared

Key

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

...

The JMM guarantees that the fully initialized values of fields that are declared final are safely published to every thread that reads those values at some point no later earlier than the end of the object's constructor.

...

Failure to synchronize access to shared mutable data can cause different threads to observe different states of the object or to observe a partially initialized object.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

TSM03-J

Medium

Probable

Medium

P8

L2

Automated Detection

ToolVersionCheckerDescription
CodeSonar Include PageCodeSonar_V
CodeSonar_VFB.MT_CORRECTNESS.DC_PARTIALLY_CONSTRUCTEDPossible exposure of partially initialized object

Bibliography

[API 2006]

 


[Bloch 2001]

Item 48, "Synchronize Access to Shared Mutable Data"

[Goetz 2006a]

Section 3.5.3, "Safe Publication Idioms"

[Goetz 2007]

Pattern #2, "One-Time Safe Publication"

[JPL 2006]

Section 14.10.2, "Final Fields and Security"

[Pugh 2004]

 

...



...