error-prone icon indicating copy to clipboard operation
error-prone copied to clipboard

error: [DoNotCall] Calling run on Thread runs work on this thread

Open tsmock opened this issue 2 years ago • 0 comments

Sample code:

class TThread extends Thread {
    @Override
    public void run() {
        this.run();
    }
}

Use cases: Thread hasn't finished processing (maybe there was an error, and the programmer wants to retry, maybe it only incrementally does stuff, and notifies a consumer about the new data, etc.).

With that said, DoNotCall should probably ignore recursive calls instead of special-casing Thread.

tsmock avatar Oct 12 '23 18:10 tsmock