Skip to content

Commit

Permalink
[#1857] Update utilities classes
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideD committed Apr 10, 2024
1 parent 3fedb05 commit 234fb21
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public static <T> CompletionStage<T> nullFuture() {
return (CompletionStage<T>) VOID;
}

public static <T> CompletionStage<T> nullFuture(Void v) {
return nullFuture();
}

public static <T> CompletionStage<T> completedFuture(T value) {
return CompletableFuture.completedFuture( value );
}
Expand Down Expand Up @@ -110,13 +114,6 @@ public static <T extends Throwable, Ret> Ret returnOrRethrow(Throwable x, Ret re
return result;
}

/**
* For CompletionStage#handle when we don't care about errors
*/
public static <U> U ignoreErrors(Void unused, Throwable throwable) {
return null;
}

public static void logSqlException(Throwable t, Supplier<String> message, String sql) {
if ( t != null ) {
LOG.failedToExecuteStatement( sql, message.get(), t );
Expand Down Expand Up @@ -225,10 +222,6 @@ public static <T> CompletionStage<Void> loop(Iterator<T> iterator, IntBiPredicat
return voidFuture();
}

public static <U> U nullFuture(Void unused) {
return null;
}

public static <R, T extends Throwable> CompletionStageHandler<R, T> handle(R result, T throwable) {
return new CompletionStageHandler<>( result, throwable );
}
Expand Down

0 comments on commit 234fb21

Please sign in to comment.