Inspectopedia Help

'ScheduledThreadPoolExecutor' with zero core threads

Reports any java.util.concurrent.ScheduledThreadPoolExecutor instances in which corePoolSize is set to zero via the setCorePoolSize method or the object constructor.

A ScheduledThreadPoolExecutor with zero core threads will run nothing.

Example:

void foo(int corePoolSize) { if (corePoolSize != 0) return; ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning executor.setCorePoolSize(corePoolSize); // warning }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023