From 94cb389c04bd084f698345aac4cb70b02e5da086 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Sat, 28 Jan 2017 20:25:22 -0500 Subject: [PATCH] Restore add(Promise) and addAll(Promise...) methods to PromiseCombiner. Motivation: A testing goof in 7c630fe introduced a binary incompatibility when the old Promise-specific `add` and `addAll` methods in PromiseCombiner were generalized to accept `Futures`. Modification: - Restore (but mark as `@Deprecated`) old PromiseCombiner methods. - Fixed a couple minor documentation typos because sure why not. Result: `PromiseCombiner` is binary-compatible with previous versions of Netty. --- .../util/concurrent/PromiseCombiner.java | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/io/netty/util/concurrent/PromiseCombiner.java b/common/src/main/java/io/netty/util/concurrent/PromiseCombiner.java index 8f7dabf10e..6624f05db1 100644 --- a/common/src/main/java/io/netty/util/concurrent/PromiseCombiner.java +++ b/common/src/main/java/io/netty/util/concurrent/PromiseCombiner.java @@ -48,9 +48,22 @@ public final class PromiseCombiner { } }; + /** + * Adds a new promise to be combined. New promises may be added until an aggregate promise is added via the + * {@link PromiseCombiner#finish(Promise)} method. + * + * @param promise the promise to add to this promise combiner + * + * @deprecated Replaced by {@link PromiseCombiner#add(Future)}. + */ + @Deprecated + public void add(Promise promise) { + add((Future) promise); + } + /** * Adds a new future to be combined. New futures may be added until an aggregate promise is added via the - * {@link PromiseCombiner#finish(Promise)} method has been called. + * {@link PromiseCombiner#finish(Promise)} method. * * @param future the future to add to this promise combiner */ @@ -61,9 +74,22 @@ public final class PromiseCombiner { future.addListener(listener); } + /** + * Adds new promises to be combined. New promises may be added until an aggregate promise is added via the + * {@link PromiseCombiner#finish(Promise)} method. + * + * @param promises the promises to add to this promise combiner + * + * @deprecated Replaced by {@link PromiseCombiner#addAll(Future[])} + */ + @Deprecated + public void addAll(Promise... promises) { + addAll((Future[]) promises); + } + /** * Adds new futures to be combined. New futures may be added until an aggregate promise is added via the - * {@link PromiseCombiner#finish(Promise)} method has been called. + * {@link PromiseCombiner#finish(Promise)} method. * * @param futures the futures to add to this promise combiner */