Use @Nullable Void in TaskCallback#from

See gh-36208
This commit is contained in:
Sébastien Deleuze
2026-01-30 13:36:29 +01:00
parent 149397ed10
commit f52481493c
2 changed files with 3 additions and 3 deletions
@@ -196,8 +196,9 @@ public class RetryTask<V extends @Nullable Object, E extends Exception> implemen
* @param retryTemplate the retry delegate to use (typically a {@link RetryTemplate}
* but declaring the {@link RetryOperations} interface for flexibility)
*/
@SuppressWarnings("NullAway") // https://github.com/uber/NullAway/issues/1451
public static Runnable wrap(Runnable task, RetryOperations retryTemplate) {
RetryTask<Void, RuntimeException> rt = new RetryTask<>(TaskCallback.from(task), retryTemplate) {
RetryTask<@Nullable Void, RuntimeException> rt = new RetryTask<>(TaskCallback.from(task), retryTemplate) {
@Override
public String getName() {
return task.getClass().getName();
@@ -55,8 +55,7 @@ public interface TaskCallback<V extends @Nullable Object, E extends Exception> e
* Derive a {@link TaskCallback} from the given {@link Runnable}.
* @since 7.0.4
*/
@SuppressWarnings("NullAway")
static TaskCallback<Void, RuntimeException> from(Runnable task) {
static TaskCallback<@Nullable Void, RuntimeException> from(Runnable task) {
return () -> {
task.run();
return null;