Browse Source

Polishing

pull/36209/head
Juergen Hoeller 1 week ago
parent
commit
fd3bbb057e
  1. 2
      spring-core/src/main/java/org/springframework/core/retry/RetryTemplate.java
  2. 11
      spring-core/src/main/java/org/springframework/core/task/AsyncTaskExecutor.java
  3. 8
      spring-core/src/test/java/org/springframework/core/retry/RetryTemplateTests.java
  4. 6
      spring-orm/src/main/java/org/springframework/orm/jpa/SharedEntityManagerCreator.java

2
spring-core/src/main/java/org/springframework/core/retry/RetryTemplate.java

@ -89,7 +89,7 @@ public class RetryTemplate implements RetryOperations { @@ -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;
}

11
spring-core/src/main/java/org/springframework/core/task/AsyncTaskExecutor.java

@ -27,14 +27,10 @@ import org.springframework.util.concurrent.FutureUtils; @@ -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 { @@ -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

8
spring-core/src/test/java/org/springframework/core/retry/RetryTemplateTests.java

@ -60,13 +60,13 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; @@ -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

6
spring-orm/src/main/java/org/springframework/orm/jpa/SharedEntityManagerCreator.java

@ -215,7 +215,7 @@ public abstract class SharedEntityManagerCreator { @@ -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 { @@ -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 { @@ -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()) {

Loading…
Cancel
Save