Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Parasoft Jtest 2021.1

...

Failure to encase the wait() or await() methods inside a while loop can lead to indefinite blocking and denial of service (DoS).

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

THI03-J

Low

Unlikely

Medium

P2

L3

Automated Detection

ToolVersionCheckerDescription
CodeSonar
Parasoft Jtest
Include Page
CodeSonar
Parasoft_V
CodeSonar
Parasoft_V
FB
CERT.
MT_CORRECTNESS.WA_AWAIT_NOT_IN_LOOP
FB.MT_CORRECTNESS.WA_NOT_IN_LOOP
THI03.UWILCall 'wait()' and 'await()' only inside a loop that tests the liveness condition
SonarQube
Include Page
SonarQube_V
SonarQube_V
S2274"Object.wait(...)" and "Condition.await(...)" should be called inside a "while" loop
Condition.await() not in loop
Wait not in loopParasoft Jtest Include Pagejava:Parasoft_Vjava:Parasoft_VTRS.UWILImplementedSonarQube Java Plugin Include PageSonarQube Java Plugin_VSonarQube Java Plugin_VS2274 

Bibliography

[API 2014]

Class Object
Interface Condition

[Bloch 2001]

Item 50, "Never Invoke wait Outside a Loop"

[Goetz 2006]

Section 14.2, "Using Condition Queues"

[Lea 2000]

Section 1.3.2, "Liveness"
Section 3.2.2, "Monitor Mechanics"

...


...