Chapter 11. Thread APIs (THI)

Rules

Image

Risk Assessment Summary

Image

THI00-J. Do not invoke Thread.run()

Thread startup can be misleading because the code can appear to be performing its function correctly when it is actually being executed by the wrong thread. Invoking the Thread.start() method instructs the Java runtime to start executing the thread’s run() method using the started thread. Invoking a Thread object’s run() method directly is incorrect. When a Thread object’s run() method is invoked directly, the statements in the run() method are executed ...

Get The CERT® Oracle® Secure Coding Standard for Java™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.