mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Align execute(TaskCallback) declaration with return value nullability
See gh-36057
This commit is contained in:
@@ -18,6 +18,8 @@ package org.springframework.core.task;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ConcurrencyThrottleSupport;
|
||||
|
||||
@@ -70,7 +72,7 @@ public class SyncTaskExecutor extends ConcurrencyThrottleSupport implements Task
|
||||
* @throws E if propagated from the given {@code TaskCallback}
|
||||
* @since 7.0
|
||||
*/
|
||||
public <V, E extends Exception> V execute(TaskCallback<V, E> task) throws E {
|
||||
public <V extends @Nullable Object, E extends Exception> V execute(TaskCallback<V, E> task) throws E {
|
||||
Assert.notNull(task, "Task must not be null");
|
||||
if (isThrottleActive()) {
|
||||
beforeAccess();
|
||||
|
||||
Reference in New Issue
Block a user