Versions Compared

Key

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

...

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

CON01- J

medium

probable

medium

P8

L2

Automated Detection

Currently, SureLogic Flashlight does not detect all violations of this guideline. It detectsThe following table summarizes the examples flagged as violations by SureLogic Flashlight:

Noncompliant Code Example

Flagged

Message

bitwise compound operation

Yes

Instance fields with empty locksets

addition

Yes

Instance fields with empty locksets

It does not detect:

Noncompliant Code Example

Message

volatile variable

No

No obvious issues

overflow check, atomic integer fields

No

No obvious issues

The following table summarizes the examples flagged as violations by SureLogic JSure:

Noncompliant Code Example

Flagged

Message

Details

Dynamic analysis tools with a Java concurrency focus, such as SureLogic Flashlight and Coverity Dynamic Analysis will uncover the race conditions shown in the noncompliant code examples above. To accomplish this, however, these tools would have to observe the noncompliant code being called by two or more threads. Such as in an integration or stress test environment. These tools use a dynamic lockset analysis to observe race conditions that occur as the program runs. This analysis intersects the set of locks that are observed to be held when each piece of shared state in the program is accessed. If the lockset for a piece of shared state is empty then a race condition may have been observed and the tool reports this to the user.

...