From c393374cf5152e376d9fe3d6b9028a46fc6f624e Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 4 Jul 2016 09:40:08 +0200 Subject: [PATCH] [#5455] Clarify ChannelPool javadocs Motivation: We should make it clear that each acquired Channel needs to be released in all cases. Modifications: More clear javadocs. Result: Harder for users to leak Channel. --- .../src/main/java/io/netty/channel/pool/ChannelPool.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/transport/src/main/java/io/netty/channel/pool/ChannelPool.java b/transport/src/main/java/io/netty/channel/pool/ChannelPool.java index 5d76aaf3cc..6e163d9f33 100644 --- a/transport/src/main/java/io/netty/channel/pool/ChannelPool.java +++ b/transport/src/main/java/io/netty/channel/pool/ChannelPool.java @@ -29,12 +29,18 @@ public interface ChannelPool extends Closeable { /** * Acquire a {@link Channel} from this {@link ChannelPool}. The returned {@link Future} is notified once * the acquire is successful and failed otherwise. + * + * Its important that an acquired is always released to the pool again, even if the {@link Channel} + * is explicitly closed.. */ Future acquire(); /** * Acquire a {@link Channel} from this {@link ChannelPool}. The given {@link Promise} is notified once * the acquire is successful and failed otherwise. + * + * Its important that an acquired is always released to the pool again, even if the {@link Channel} + * is explicitly closed.. */ Future acquire(Promise promise);