Sho SHIMIZU
Committed by Gerrit Code Review

Refactor: Consolidate multiple map() invocations to single invocation

Change-Id: I53bd6a80f34469eb23874f91dd52a895e0f5a2dc
...@@ -325,15 +325,15 @@ public class IntentManager ...@@ -325,15 +325,15 @@ public class IntentManager
325 (we can also try to update these individually) 325 (we can also try to update these individually)
326 */ 326 */
327 List<CompletableFuture<IntentData>> futures = operations.stream() 327 List<CompletableFuture<IntentData>> futures = operations.stream()
328 - .map(CompletableFuture::completedFuture) 328 + .map(x -> CompletableFuture.completedFuture(x)
329 - .map(x -> x.thenApply(IntentManager.this::createInitialPhase)) 329 + .thenApply(IntentManager.this::createInitialPhase)
330 - .map(x -> x.thenApplyAsync(IntentManager.this::process, workerExecutor)) 330 + .thenApplyAsync(IntentManager.this::process, workerExecutor)
331 - .map(x -> x.thenApply(FinalIntentProcessPhase::data)) 331 + .thenApply(FinalIntentProcessPhase::data)
332 - .map(x -> x.exceptionally(e -> { 332 + .exceptionally(e -> {
333 - //FIXME 333 + //FIXME
334 - log.warn("Future failed: {}", e); 334 + log.warn("Future failed: {}", e);
335 - return null; 335 + return null;
336 - })) 336 + }))
337 .collect(Collectors.toList()); 337 .collect(Collectors.toList());
338 store.batchWrite(Tools.allOf(futures).join().stream() 338 store.batchWrite(Tools.allOf(futures).join().stream()
339 .filter(Objects::nonNull) 339 .filter(Objects::nonNull)
......