From f41a568b1d4f56cfb9748e89b54b1f4ebdb2e95b Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:31:50 +0200 Subject: [PATCH] Improve Javadoc for RetryPolicy.Builder --- .../java/org/springframework/core/retry/RetryPolicy.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spring-core/src/main/java/org/springframework/core/retry/RetryPolicy.java b/spring-core/src/main/java/org/springframework/core/retry/RetryPolicy.java index 240c041968..cf314f1e41 100644 --- a/spring-core/src/main/java/org/springframework/core/retry/RetryPolicy.java +++ b/spring-core/src/main/java/org/springframework/core/retry/RetryPolicy.java @@ -99,6 +99,8 @@ public interface RetryPolicy { /** * Specify the maximum number of retry attempts. + *

If a {@code maxAttempts} value has already been configured, the + * supplied value will override the existing value. * @param maxAttempts the maximum number of retry attempts; must be * greater than zero * @return this {@code Builder} instance for chained method invocations @@ -111,6 +113,8 @@ public interface RetryPolicy { /** * Specify the maximum retry {@link Duration}. + *

If a {@code maxDuration} value has already been configured, the + * supplied value will override the existing value. * @param maxDuration the maximum retry duration; must be positive * @return this {@code Builder} instance for chained method invocations */ @@ -123,6 +127,9 @@ public interface RetryPolicy { /** * Specify the types of exceptions for which the {@link RetryPolicy} * should retry a failed operation. + *

Defaults to all exception types. + *

If included exception types have already been configured, the supplied + * types will be added to the existing list of included types. *

This can be combined with {@link #excludes(Class...)} and * {@link #predicate(Predicate)}. * @param types the types of exceptions to include in the policy @@ -138,6 +145,8 @@ public interface RetryPolicy { /** * Specify the types of exceptions for which the {@link RetryPolicy} * should not retry a failed operation. + *

If excluded exception types have already been configured, the supplied + * types will be added to the existing list of excluded types. *

This can be combined with {@link #includes(Class...)} and * {@link #predicate(Predicate)}. * @param types the types of exceptions to exclude from the policy