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.
public void do(){ ScheduledThreadPoolExecutor stpe1 = new ScheduledThreadPoolExecutor(0); // Noncompliant ScheduledThreadPoolExecutor stpe2 = new ScheduledThreadPoolExecutor(POOL_SIZE); stpe2.setCorePoolSize(0); // Noncompliant