eugenp/tutorials

[ISSUE] Wrong example code in https://www.baeldung.com/java-completablefuture

Closed this issue · 1 comments

Article and Module Links
https://www.baeldung.com/java-completablefuture

Describe the Issue

CompletableFuture<String> completableFuture 
  = CompletableFuture.supplyAsync(() -> "Hello")
    .thenCombine(CompletableFuture.supplyAsync(
      () -> " World"), (s1, s2) -> s1 + s2));

There should not be the last close parentheses.

Expected Behavior

CompletableFuture<String> completableFuture 
  = CompletableFuture.supplyAsync(() -> "Hello")
    .thenCombine(CompletableFuture.supplyAsync(
      () -> " World"), (s1, s2) -> s1 + s2);

Screenshots

image

Hey, @lovelock.

Thanks for the feedback. We've updated the article to fix this.

Cheers,
Team