Versions Compared

Key

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

...

Forcing a thread to stop can result in inconsistent object state. Critical resources could also leak if cleanup operations are not carried out as required.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

THI05-J

Low

Probable

Medium

P4

L3

Automated Detection

ToolVersionCheckerDescription
Parasoft Jtest
Include Page
Parasoft_V
Parasoft_V
CERT.THI05.THRDAvoid calling unsafe deprecated methods of 'Thread' and 'Runtime'

Related Guidelines

Android Implementation Details

On Android, Thread.stop() was deprecated in API level 1.

Bibliography

[API 2006]

Class Thread, Method stop
InterfaceExecutorService

[Darwin 2004]

Section 24.3, "Stopping a Thread"

[Goetz 2006]

Chapter 7, "Cancellation and Shutdown"

[JavaThreads 2004]

Section 2.4, "Two Approaches to Stopping a Thread"

[JDK7 2008]

Concurrency Utilities, More information: Java Thread Primitive Deprecation

[JPL 2006]

Section 14.12.1, "Don't Stop"
Section 23.3.3, "Shutdown Strategies"

[Sun 1999]

 

...



...