commit | 05abf1388e1396553f11c256656baf3717468bdf | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Thu Jan 14 16:29:51 2016 -0800 |
committer | Gerrit Code Review <gerrit@onlab.us> | Fri Jan 15 22:30:01 2016 +0000 |
tree | 9293c55fece771004e276a92dc0f141c1417c6b1 | |
parent | 69f6663f3ae2b7e6018eba276a4fe0ecb9e94d84 [diff] |
Refactor: Generate CompletableFuture first, then process it Change-Id: I1ef5961a863b855ce2687fcbacd2159c77cb64ce
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java index a530797..71c8764 100644 --- a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java +++ b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentManager.java
@@ -325,8 +325,8 @@ (we can also try to update these individually) */ List<CompletableFuture<IntentData>> futures = operations.stream() - .map(IntentManager.this::createInitialPhase) .map(CompletableFuture::completedFuture) + .map(x -> x.thenApply(IntentManager.this::createInitialPhase)) .map(x -> x.thenApplyAsync(IntentManager.this::process, workerExecutor)) .map(x -> x.thenApply(FinalIntentProcessPhase::data)) .map(x -> x.exceptionally(e -> {