File tree Expand file tree Collapse file tree
src/main/java/lambdasinaction/chap11 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,9 +53,14 @@ public List<String> findPricesFuture(String product) {
5353
5454 public Stream <CompletableFuture <String >> findPricesStream (String product ) {
5555 return shops .stream ()
56- .map (shop -> CompletableFuture .supplyAsync (() -> shop .getPrice (product ), executor ))
56+ .map (shop -> CompletableFuture .supplyAsync (
57+ () -> shop .getPrice (product ),
58+ executor ))
5759 .map (future -> future .thenApply (Quote ::parse ))
58- .map (future -> future .thenCompose (quote -> CompletableFuture .supplyAsync (() -> Discount .applyDiscount (quote ), executor )));
60+ .map (future -> future .thenCompose (quote -> CompletableFuture .supplyAsync (
61+ () -> Discount .applyDiscount (quote ),
62+ executor ))
63+ );
5964 }
6065
6166 public void printPricesStream (String product ) {
You can’t perform that action at this time.
0 commit comments