According the Java documentation on ScheduledThreadPoolExecutor, it is not a good idea to set corePoolSize to zero, since doing so indicates the executor to keep 0 threads in its pool and the executor will serve no purpose.
Set the ScheduledThreadPoolExecutor to have 1 or more threads in its thread pool and use the class's other methods to create a thread execution schedule.
public class Test {
void f() {
int i = 0;
ScheduledThreadPoolExecutor s = new ScheduledThreadPoolExecutor(1); // COMPLIANT
ScheduledThreadPoolExecutor s1 = new ScheduledThreadPoolExecutor(0); // NON_COMPLIANT
s.setCorePoolSize(0); // NON_COMPLIANT
s.setCorePoolSize(i); // NON_COMPLIANT
}
}