JDK-8145521 : ScheduledThreadPoolExecutor JavaDoc describes it wrongly as a fixed-size pool
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util.concurrent
  • Affected Version: 8u66
  • Priority: P4
  • Status: Resolved
  • Resolution: Not an Issue
  • Submitted: 2015-12-15
  • Updated: 2015-12-16
  • Resolved: 2015-12-16
Description
A DESCRIPTION OF THE REQUEST :
The JavaDoc of class ScheduledThreadPoolExecutor documents the behavior as a fixed-size ThreadPoolExecutor: 

-- quote -- 
While this class inherits from ThreadPoolExecutor, a few of the inherited tuning methods are not useful for it. In particular, because it acts as a fixed-sized pool using corePoolSize threads and an unbounded queue, adjustments to maximumPoolSize have no useful effect.
-- quote -- 

In fact the ScheduledThreadPoolExecutor calls its parent constructor with Integer.MAX_VALUE as maximumPoolSize. 

JUSTIFICATION :
Misleading documentation can lead to wrong error analysis or system performance estimations.  



Comments
I agree with David's analysis
16-12-2015

The documentation is correct. The pool size is irrelevant because of the use of an unbounded queue. A ThreadPoolExecutor will create up to coreSize threads before it starts queuing tasks. Once the queue becomes full then the executor will start to create threads up to the maximum size, after which it will reject submission. As the queue is unbounded in this case it will never be full and the executor will never create additional threads beyond the coreSize.
16-12-2015

Below is the url of the API being referred to: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html
16-12-2015