Description
org.apache.mina.filter.executor.OrderedThreadPoolExecutor inherits from java.util.concurrent.ThreadPoolExecutor
OrderedThreadPoolExecutor, in its constructor, calls these two methods from its parent to determine pool sizing:
super.setCorePoolSize(corePoolSize); super.setMaximumPoolSize(maximumPoolSize);
This works fine up until Java 8. In Java 10 (possibly 9 - I did not check), an additional input validation was added to ThreadPoolExecutor#setCorePoolSize: maximumPoolSize < corePoolSize
ThreadPoolExecutor Java 8:
public void setCorePoolSize(int corePoolSize) { if (corePoolSize < 0) throw new IllegalArgumentException(); public void setMaximumPoolSize(int maximumPoolSize) { if (maximumPoolSize <= 0 || maximumPoolSize < corePoolSize) throw new IllegalArgumentException();
ThreadPoolExecutor Java 10:
public void setCorePoolSize(int corePoolSize) { if (corePoolSize < 0 || maximumPoolSize < corePoolSize) throw new IllegalArgumentException(); public void setMaximumPoolSize(int maximumPoolSize) { if (maximumPoolSize <= 0 || maximumPoolSize < corePoolSize) throw new IllegalArgumentException();
As a result, the first line of this part of the constructor of OrderedThreadPoolExecutor now throws an IllegalArgumentException.
super.setCorePoolSize(corePoolSize); super.setMaximumPoolSize(maximumPoolSize);
Attachments
Attachments
Issue Links
- is duplicated by
-
DIRMINA-1090 OrderedThreadPoolExecutor constructor throws exception if corePoolsize is > 1
- Resolved