mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Use @Nullable Void in TaskCallback#from
See gh-36208
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user