Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed to Applicability and corrected some links

...

The @ThreadSafe annotation is applied to a class to indicate that it is thread-safe. This means that no sequences of accesses (reads and writes to public fields, calls to public methods) can leave the object in an inconsistent state regardless of the interleaving of these accesses by the runtime or any external synchronization or coordination on the part of the caller.

...

The @Immutable annotation is applied to to immutable classes. Immutable objects are inherently thread-safe; after they are fully constructed, they may be published via a volatile reference and shared safely among multiple threads.

...

Wait-notify protocols should be documented adequately. Currently, we are not aware of any annotations for this purpose.

...

Applicability

Annotating concurrent code documents design intent and can be used to automate the detection and prevention of race conditions and data races.

...

...

Severity

...

Likelihood

...

Remediation Cost

...

Priority

...

Level

...

CON52-JG

...

low

...

probable

...

medium

...

P4

...

L3

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Bibliography

[Bloch 2008]

Item 70: "Document thread safety"

[Goetz 2006]

 

[Sutherland 2010]

 

 

...

Image Modified