From d74b863ae73d9ebd849b2ecec52f5dc4b2f18d52 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 11 Jun 2025 13:49:00 +0200 Subject: [PATCH] Polish Javadoc for core retry functionality See gh-34716 --- .../java/org/springframework/core/retry/RetryExecution.java | 3 +++ .../java/org/springframework/core/retry/RetryTemplate.java | 4 +++- .../org/springframework/core/retry/support/package-info.java | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/retry/RetryExecution.java b/spring-core/src/main/java/org/springframework/core/retry/RetryExecution.java index f021911cd7..e0d7e84b90 100644 --- a/spring-core/src/main/java/org/springframework/core/retry/RetryExecution.java +++ b/spring-core/src/main/java/org/springframework/core/retry/RetryExecution.java @@ -20,6 +20,9 @@ package org.springframework.core.retry; * Strategy interface to define a retry execution created for a given * {@link RetryPolicy}. * + *
A {@code RetryExecution} is effectively an executable instance of a given + * {@code RetryPolicy}. + * *
Implementations may be stateful but do not need to be thread-safe. * * @author Mahmoud Ben Hassine 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 38cd22882b..115c04ece5 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 @@ -66,6 +66,7 @@ public class RetryTemplate implements RetryOperations { protected RetryListener retryListener = new RetryListener() { }; + /** * Create a new {@code RetryTemplate} with maximum 3 retry attempts and a * fixed backoff of 1 second. @@ -95,6 +96,7 @@ public class RetryTemplate implements RetryOperations { this.backOffPolicy = backOffPolicy; } + /** * Set the {@link RetryPolicy} to use. *
Defaults to {@code new MaxRetryAttemptsPolicy()}. @@ -108,7 +110,7 @@ public class RetryTemplate implements RetryOperations { /** * Set the {@link BackOff} policy to use. - *
Defaults to {@code new FixedBackOff(1000, Long.MAX_VALUE))}. + *
Defaults to {@code new FixedBackOff(Duration.ofSeconds(1))}. * @param backOffPolicy the backoff policy to use * @see FixedBackOff */ diff --git a/spring-core/src/main/java/org/springframework/core/retry/support/package-info.java b/spring-core/src/main/java/org/springframework/core/retry/support/package-info.java index 598666fab6..9a42d8400c 100644 --- a/spring-core/src/main/java/org/springframework/core/retry/support/package-info.java +++ b/spring-core/src/main/java/org/springframework/core/retry/support/package-info.java @@ -1,5 +1,5 @@ /** - * Support package for the core retry functionality containing common retry policies. + * Support package for the core retry functionality. */ @NullMarked package org.springframework.core.retry.support;