File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
spring-core/src/main/java/org/springframework/core/task Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 2121import java .util .concurrent .Future ;
2222import java .util .concurrent .FutureTask ;
2323
24+ import org .jspecify .annotations .Nullable ;
25+
2426import org .springframework .util .concurrent .FutureUtils ;
2527
2628/**
@@ -105,7 +107,7 @@ default Future<?> submit(Runnable task) {
105107 * @throws TaskRejectedException if the given task was not accepted
106108 * @since 3.0
107109 */
108- default <T > Future <T > submit (Callable <T > task ) {
110+ default <T extends @ Nullable Object > Future <T > submit (Callable <T > task ) {
109111 FutureTask <T > future = new FutureTask <>(task );
110112 execute (future , TIMEOUT_INDEFINITE );
111113 return future ;
@@ -132,7 +134,7 @@ default CompletableFuture<Void> submitCompletable(Runnable task) {
132134 * @throws TaskRejectedException if the given task was not accepted
133135 * @since 6.0
134136 */
135- default <T > CompletableFuture <T > submitCompletable (Callable <T > task ) {
137+ default <T extends @ Nullable Object > CompletableFuture <T > submitCompletable (Callable <T > task ) {
136138 return FutureUtils .callAsync (task , this );
137139 }
138140
You can’t perform that action at this time.
0 commit comments