File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
spring-core/src/main/java/org/springframework/util/concurrent Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 21
21
import java .util .concurrent .ExecutionException ;
22
22
import java .util .concurrent .TimeUnit ;
23
23
import java .util .concurrent .TimeoutException ;
24
+ import java .util .function .BiConsumer ;
24
25
25
26
/**
26
27
* Adapts a {@link CompletableFuture} or {@link CompletionStage} into a
@@ -50,14 +51,13 @@ public CompletableToListenableFutureAdapter(CompletionStage<T> completionStage)
50
51
*/
51
52
public CompletableToListenableFutureAdapter (CompletableFuture <T > completableFuture ) {
52
53
this .completableFuture = completableFuture ;
53
- this .completableFuture .handle ((result , ex ) -> {
54
+ this .completableFuture .whenComplete ((result , ex ) -> {
54
55
if (ex != null ) {
55
56
callbacks .failure (ex );
56
57
}
57
58
else {
58
59
callbacks .success (result );
59
60
}
60
- return null ;
61
61
});
62
62
}
63
63
You can’t perform that action at this time.
0 commit comments