From 1dfbab06429ac74e56eb161fc0c2456e184154f1 Mon Sep 17 00:00:00 2001 From: a-mkarjalainen Date: Thu, 18 Jun 2015 11:48:20 +0100 Subject: [PATCH] Fix broken constructor chaining for FixedChannelPool class. Motivation: Only one of the three FixedChannelPool constructors checks for the constructor arguments. Therfore it was possible to create a pool with zero maxConnections. This change chains all constructors together, so that the last one in the chain always checks the validity of the arguments, regardless of the constructor used. Result: It is no longer possible to create a FixedChannelPool instance with invalid maxConnections or maxPendingAcquires parameters. --- .../main/java/io/netty/channel/pool/FixedChannelPool.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/transport/src/main/java/io/netty/channel/pool/FixedChannelPool.java b/transport/src/main/java/io/netty/channel/pool/FixedChannelPool.java index ddafebb8d3..5c08ac6260 100644 --- a/transport/src/main/java/io/netty/channel/pool/FixedChannelPool.java +++ b/transport/src/main/java/io/netty/channel/pool/FixedChannelPool.java @@ -96,12 +96,7 @@ public final class FixedChannelPool extends SimpleChannelPool { */ public FixedChannelPool(Bootstrap bootstrap, ChannelPoolHandler handler, int maxConnections, int maxPendingAcquires) { - super(bootstrap, handler); - executor = bootstrap.group().next(); - timeoutTask = null; - acquireTimeoutNanos = -1; - this.maxConnections = maxConnections; - this.maxPendingAcquires = maxPendingAcquires; + this(bootstrap, handler, ChannelHealthChecker.ACTIVE, null, -1, maxConnections, maxPendingAcquires); } /**