mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Declare TaskCallback return value as potentially nullable
Closes gh-36057
This commit is contained in:
@@ -18,6 +18,8 @@ package org.springframework.core.task;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Variant of {@link Callable} with a flexible exception signature
|
||||
* that can be adapted in the {@link SyncTaskExecutor#execute(TaskCallback)}
|
||||
@@ -34,7 +36,7 @@ import java.util.concurrent.Callable;
|
||||
* @param <E> the exception propagated, if any
|
||||
* @see SyncTaskExecutor#execute(TaskCallback)
|
||||
*/
|
||||
public interface TaskCallback<V, E extends Exception> extends Callable<V> {
|
||||
public interface TaskCallback<V extends @Nullable Object, E extends Exception> extends Callable<V> {
|
||||
|
||||
@Override
|
||||
V call() throws E;
|
||||
|
||||
Reference in New Issue
Block a user