...
Failure to ensure the atomicity of two or more operations that must be performed as a single atomic operation can result in race conditions in multithreaded applications.
Rule | Severity | Likelihood | Detectable | RepairableRemediation Cost | Priority | Level |
|---|---|---|---|---|---|---|
VNA03-J | Low | Probable | No | MediumNo | P4P2 | L3 |
Automated Detection
Some static analysis tools are capable of detecting violations of this rule.
| Tool | Version | Checker | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| CodeSonar | 4.2 | FB.MT_CORRECTNESS.IS2_INCONSISTENT_SYNC FB.MT_CORRECTNESS.IS_FIELD_NOT_GUARDED FB.MT_CORRECTNESS.STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE FB.MT_CORRECTNESS.STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE FB.MT_CORRECTNESS.STCAL_STATIC_CALENDAR_INSTANCE FB.MT_CORRECTNESS.STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE |
| JAVA.CONCURRENCY.VOLATILE | Useless volatile Modifier (Java)Inconsistent synchronization Field not guarded against concurrent access Call to static Calendar Call to static DateFormat Static Calendar field Static DateFormat | ||||||
| Coverity | 7.5 | ATOMICITY | Implemented | ||||||||
| Parasoft Jtest |
| CERT.VNA03.SSUG CERT.VNA03.MRAV | Make the get method for a field synchronized if the set method is synchronized Access related Atomic variables in a synchronized block | ||||||||
| ThreadSafe |
| CCE_CC_NON_ATOMIC_GCP | Implemented |
Related Guidelines
...