Polishing

This commit is contained in:
Juergen Hoeller
2026-01-25 10:42:13 +01:00
parent c47da1247a
commit fd3bbb057e
4 changed files with 11 additions and 16 deletions
@@ -89,7 +89,7 @@ public class RetryTemplate implements RetryOperations {
* @see RetryPolicy#builder()
*/
public void setRetryPolicy(RetryPolicy retryPolicy) {
Assert.notNull(retryPolicy, "Retry policy must not be null");
Assert.notNull(retryPolicy, "RetryPolicy must not be null");
this.retryPolicy = retryPolicy;
}
@@ -27,14 +27,10 @@ import org.springframework.util.concurrent.FutureUtils;
/**
* Extended interface for asynchronous {@link TaskExecutor} implementations,
* offering support for {@link java.util.concurrent.Callable}.
*
* <p>Note: The {@link java.util.concurrent.Executors} class includes a set of
* methods that can convert some other common closure-like objects, for example,
* {@link java.security.PrivilegedAction} to {@link Callable} before executing them.
* offering support for {@link Future}/{@link CompletableFuture} handles.
*
* <p>Implementing this interface also indicates that the {@link #execute(Runnable)}
* method will not execute its Runnable in the caller's thread but rather
* method will not execute the given Runnable in the caller's thread but rather
* asynchronously in some other thread.
*
* @author Juergen Hoeller
@@ -127,8 +123,7 @@ public interface AsyncTaskExecutor extends TaskExecutor {
/**
* Submit a {@code Callable} task for execution, receiving a {@code CompletableFuture}
* representing that task. The Future will return the Callable's result upon
* completion.
* representing that task. The Future will return the Callable's result upon completion.
* @param task the {@code Callable} to execute (never {@code null})
* @return a {@code CompletableFuture} representing pending completion of the task
* @throws TaskRejectedException if the given task was not accepted
@@ -60,13 +60,13 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
*/
class RetryTemplateTests {
private final RetryPolicy retryPolicy = RetryPolicy.builder().maxRetries(3).delay(Duration.ZERO).build();
RetryPolicy retryPolicy = RetryPolicy.builder().maxRetries(3).delay(Duration.ZERO).build();
private final RetryTemplate retryTemplate = new RetryTemplate(retryPolicy);
RetryTemplate retryTemplate = new RetryTemplate(retryPolicy);
private final RetryListener retryListener = mock();
RetryListener retryListener = mock();
private final InOrder inOrder = inOrder(retryListener);
InOrder inOrder = inOrder(retryListener);
@BeforeEach
@@ -215,7 +215,7 @@ public abstract class SharedEntityManagerCreator {
}
@Override
public @Nullable Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
public @Nullable Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable {
// Invocation on EntityManager interface coming in...
switch (method.getName()) {
@@ -361,7 +361,7 @@ public abstract class SharedEntityManagerCreator {
private @Nullable EntityManager entityManager;
private @Nullable Map<Object, Object> outputParameters;
private @Nullable Map<@Nullable Object, @Nullable Object> outputParameters;
public DeferredQueryInvocationHandler(Query target, EntityManager entityManager) {
this.target = target;
@@ -369,7 +369,7 @@ public abstract class SharedEntityManagerCreator {
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
public @Nullable Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable {
// Invocation on Query interface coming in...
switch (method.getName()) {