551 |
|
public CompletableFuture<Integer> apply(Integer x) { |
552 |
|
invoked(); |
553 |
|
value = x; |
554 |
< |
CompletableFuture<Integer> f = new CompletableFuture<>(); |
555 |
< |
assertTrue(f.complete(inc(x))); |
556 |
< |
return f; |
554 |
> |
return CompletableFuture.completedFuture(inc(x)); |
555 |
|
} |
556 |
|
} |
557 |
|
|
572 |
|
ExceptionalCompletableFutureFunction(ExecutionMode m) { super(m); } |
573 |
|
public CompletionStage<Integer> apply(Throwable x) { |
574 |
|
invoked(); |
575 |
< |
CompletableFuture<Integer> d = new CompletableFuture<Integer>(); |
578 |
< |
d.complete(value); |
579 |
< |
return d; |
575 |
> |
return CompletableFuture.completedFuture(value); |
576 |
|
} |
577 |
|
} |
578 |
|
|