diff --git a/spring-core/src/main/java/org/springframework/core/retry/RetryOperations.java b/spring-core/src/main/java/org/springframework/core/retry/RetryOperations.java index c72c6f05e84..45d99c7e5c1 100644 --- a/spring-core/src/main/java/org/springframework/core/retry/RetryOperations.java +++ b/spring-core/src/main/java/org/springframework/core/retry/RetryOperations.java @@ -41,6 +41,6 @@ public interface RetryOperations { * encountered during retry attempts should be made available as suppressed * exceptions */ - R execute(Retryable retryable) throws RetryException; + @Nullable R execute(Retryable retryable) throws RetryException; } diff --git a/spring-core/src/main/java/org/springframework/core/retry/RetryTemplate.java b/spring-core/src/main/java/org/springframework/core/retry/RetryTemplate.java index 40cca6a2647..04e6da98123 100644 --- a/spring-core/src/main/java/org/springframework/core/retry/RetryTemplate.java +++ b/spring-core/src/main/java/org/springframework/core/retry/RetryTemplate.java @@ -142,7 +142,7 @@ public class RetryTemplate implements RetryOperations { * encountered during retry attempts are available as suppressed exceptions */ @Override - public R execute(Retryable retryable) throws RetryException { + public @Nullable R execute(Retryable retryable) throws RetryException { String retryableName = retryable.getName(); // Initial attempt try {