Skip to content

Commit 0b2bb7e

Browse files
committed
Declare TaskCallback return value as potentially nullable
Closes gh-36057
1 parent faa17ab commit 0b2bb7e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-core/src/main/java/org/springframework/core/task/TaskCallback.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
import java.util.concurrent.Callable;
2020

21+
import org.jspecify.annotations.Nullable;
22+
2123
/**
2224
* Variant of {@link Callable} with a flexible exception signature
2325
* that can be adapted in the {@link SyncTaskExecutor#execute(TaskCallback)}
@@ -34,7 +36,7 @@
3436
* @param <E> the exception propagated, if any
3537
* @see SyncTaskExecutor#execute(TaskCallback)
3638
*/
37-
public interface TaskCallback<V, E extends Exception> extends Callable<V> {
39+
public interface TaskCallback<V extends @Nullable Object, E extends Exception> extends Callable<V> {
3840

3941
@Override
4042
V call() throws E;

0 commit comments

Comments
 (0)