aboutsummaryrefslogtreecommitdiffstats
path: root/jdisc_core
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahoo-inc.com>2017-04-20 15:08:02 +0200
committerArne H Juul <arnej@yahoo-inc.com>2017-04-20 15:17:36 +0200
commitebd2831a39aacac6278fc3f4f13aa194eb37a772 (patch)
tree5e385995e39eb81aa218b60edd2cd9dce0fd08aa /jdisc_core
parent88a760736b35e0b388081499ee02dcbaee6677d7 (diff)
rewrite to avoid warning
Diffstat (limited to 'jdisc_core')
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDispatch.java7
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