S2438 FN on arguments whose concrete type is Thread

Description

Rule S2438 should raise an issue each time a Thread is passed where a Runnable is expected.
In this example, the rule fails to raise any issue:

try (ExecutorService executor = Executors.newFixedThreadPool(10)) { Runnable iAmActuallyAThread = new Thread(() -> {}); executor.execute(iAmActuallyAThread); // FN }

The logic of the rule here is “lazy” and does not check if it can resolve more explicitly the actual type of the argument being passed.

Activity

Michael GumowskiJanuary 23, 2024 at 1:52 PM

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Priority

Sentry

Created January 23, 2024 at 1:52 PM
Updated October 16, 2024 at 2:06 PM
Resolved April 2, 2024 at 9:07 AM