Skip to content

Commit

Permalink
修正FutureHelper.isError的实现
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Jan 13, 2025
1 parent e0328af commit a173304
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,10 @@ private static boolean isSuccess(CompletionStage<?> f) {
public static boolean isError(CompletionStage<?> f) {
if (f instanceof ResolvedPromise)
return ((ResolvedPromise<?>) f).getException() != null;
return true;
if (f instanceof CompletableFuture) {
return ((CompletableFuture<?>) f).isCompletedExceptionally();
}
return false;
}

public static CompletableFuture<?> waitAnySuccess(Collection<? extends CompletionStage> futures) {
Expand Down

0 comments on commit a173304

Please sign in to comment.