java.util.concurrent.ScheduledThreadPoolExecutor
's pool is sized with corePoolSize
, so setting corePoolSize
to zero means the executor will have no threads and run nothing.
This rule detects instances where corePoolSize
is set to zero, via either its setter or the object constructor.
Noncompliant code example
fun do() {
val stpe1 = ScheduledThreadPoolExecutor(0) // Noncompliant
val stpe2 = ScheduledThreadPoolExecutor(POOL_SIZE)
stpe2.corePoolSize = 0 // Noncompliant
...