...
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
Item 70: "Document thread safety" | |
| |
|
...