Browse Source

Align execute(TaskCallback) declaration with return value nullability

See gh-36057
pull/36071/head
Juergen Hoeller 1 month ago
parent
commit
fd6e15bb4d
  1. 4
      spring-core/src/main/java/org/springframework/core/task/SyncTaskExecutor.java

4
spring-core/src/main/java/org/springframework/core/task/SyncTaskExecutor.java

@ -18,6 +18,8 @@ package org.springframework.core.task; @@ -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 @@ -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();

Loading…
Cancel
Save