diff options
author | Arne H Juul <arnej@yahoo-inc.com> | 2017-04-20 15:08:02 +0200 |
---|---|---|
committer | Arne H Juul <arnej@yahoo-inc.com> | 2017-04-20 15:17:36 +0200 |
commit | ebd2831a39aacac6278fc3f4f13aa194eb37a772 (patch) | |
tree | 5e385995e39eb81aa218b60edd2cd9dce0fd08aa | |
parent | 88a760736b35e0b388081499ee02dcbaee6677d7 (diff) |
rewrite to avoid warning
-rw-r--r-- | jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDispatch.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDispatch.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDispatch.java index 02c752ceae9..313be743dd9 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDispatch.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDispatch.java @@ -12,6 +12,8 @@ import com.yahoo.jdisc.References; import java.nio.ByteBuffer; import java.util.Collections; import java.util.concurrent.*; +import java.util.ArrayList; +import java.util.List; /** * <p>This class provides a convenient way of safely dispatching a {@link Request}. Using this class you do not have to @@ -116,7 +118,10 @@ public abstract class RequestDispatch implements ListenableFuture<Response>, Res @Override public void addListener(Runnable listener, Executor executor) { - Futures.allAsList(completions, futureResponse).addListener(listener, executor); + List<ListenableFuture<?>> combined = new ArrayList<>(2); + combined.add(completions); + combined.add(futureResponse); + Futures.allAsList(combined).addListener(listener, executor); } @Override |