The maximum pool size of a ScheduledThreadPoolExecutor is set, which has no effect
What it finds
A ScheduledThreadPoolExecutor acts as a pool of fixed size: its queue is unbounded, so it never grows past the core size, and the documentation says that adjusting the maximum size has no useful effect. setCorePoolSize is what changes its size.
Reported is setMaximumPoolSize on a variable or instance creation of ScheduledThreadPoolExecutor.
From the rule's source, scheduled_pool_max_size.rs.
import java.util.concurrent.ScheduledThreadPoolExecutor;import java.util.concurrent.ThreadPoolExecutor; class Pools { void size(ScheduledThreadPoolExecutor scheduled, ThreadPoolExecutor plain) { scheduled.setMaximumPoolSize(10);tx0 reports: never grows past its core size plain.setMaximumPoolSize(10); }} Turn it on, off or suppress it
The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:
[rules]
"tx0/java:scheduled-pool-max-size" = "off"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/java:scheduled-pool-max-size] reason="..."tx0 explain tx0/java:scheduled-pool-max-size shows the same in the terminal. Found a false positive? Report it.