From c5fd57d92bf4591b14f77933b2397b2655b41778 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Tue, 17 Jun 2025 17:07:15 +0200 Subject: [PATCH] =?UTF-8?q?Polish=20@=E2=81=A0Retryable=20Javadoc=20and=20?= =?UTF-8?q?internals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aop/retry/AbstractRetryInterceptor.java | 1 - .../org/springframework/aop/retry/MethodRetrySpec.java | 6 +++--- .../annotation/RetryAnnotationBeanPostProcessor.java | 4 ++-- .../aop/retry/annotation/Retryable.java | 8 ++++---- .../util/backoff/ExponentialBackOff.java | 10 +++++----- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/retry/AbstractRetryInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/retry/AbstractRetryInterceptor.java index f10db302467..11dd2609d2a 100644 --- a/spring-aop/src/main/java/org/springframework/aop/retry/AbstractRetryInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/retry/AbstractRetryInterceptor.java @@ -118,7 +118,6 @@ public abstract class AbstractRetryInterceptor implements MethodInterceptor { } @Override public String getName() { - Object target = invocation.getThis(); return ClassUtils.getQualifiedMethodName(method, (target != null ? target.getClass() : null)); } }); diff --git a/spring-aop/src/main/java/org/springframework/aop/retry/MethodRetrySpec.java b/spring-aop/src/main/java/org/springframework/aop/retry/MethodRetrySpec.java index 1f60ab6744c..919648fc5cc 100644 --- a/spring-aop/src/main/java/org/springframework/aop/retry/MethodRetrySpec.java +++ b/spring-aop/src/main/java/org/springframework/aop/retry/MethodRetrySpec.java @@ -26,8 +26,8 @@ import java.util.Collections; * * @author Juergen Hoeller * @since 7.0 - * @param includes applicable exceptions types to attempt a retry for - * @param excludes non-applicable exceptions types to avoid a retry for + * @param includes applicable exception types to attempt a retry for + * @param excludes non-applicable exception types to avoid a retry for * @param predicate a predicate for filtering exceptions from applicable methods * @param maxAttempts the maximum number of retry attempts * @param delay the base delay after the initial invocation (in milliseconds) @@ -49,7 +49,7 @@ public record MethodRetrySpec( long maxDelay) { public MethodRetrySpec(MethodRetryPredicate predicate, int maxAttempts, long delay) { - this(predicate, maxAttempts, delay, 0,1.0, Integer.MAX_VALUE); + this(predicate, maxAttempts, delay, 0, 1.0, Integer.MAX_VALUE); } public MethodRetrySpec(MethodRetryPredicate predicate, int maxAttempts, long delay, diff --git a/spring-aop/src/main/java/org/springframework/aop/retry/annotation/RetryAnnotationBeanPostProcessor.java b/spring-aop/src/main/java/org/springframework/aop/retry/annotation/RetryAnnotationBeanPostProcessor.java index 7161746b7db..8a377298ee6 100644 --- a/spring-aop/src/main/java/org/springframework/aop/retry/annotation/RetryAnnotationBeanPostProcessor.java +++ b/spring-aop/src/main/java/org/springframework/aop/retry/annotation/RetryAnnotationBeanPostProcessor.java @@ -21,10 +21,10 @@ import org.springframework.aop.framework.autoproxy.AbstractBeanFactoryAwareAdvis import org.springframework.aop.support.ComposablePointcut; import org.springframework.aop.support.DefaultPointcutAdvisor; import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; -import org.springframework.beans.factory.config.BeanPostProcessor; /** - * A convenient {@link BeanPostProcessor} that applies {@link RetryAnnotationInterceptor} + * A convenient {@link org.springframework.beans.factory.config.BeanPostProcessor + * BeanPostProcessor} that applies {@link RetryAnnotationInterceptor} * to all bean methods annotated with {@link Retryable} annotations. * * @author Juergen Hoeller diff --git a/spring-aop/src/main/java/org/springframework/aop/retry/annotation/Retryable.java b/spring-aop/src/main/java/org/springframework/aop/retry/annotation/Retryable.java index d4dde381f68..530230ce422 100644 --- a/spring-aop/src/main/java/org/springframework/aop/retry/annotation/Retryable.java +++ b/spring-aop/src/main/java/org/springframework/aop/retry/annotation/Retryable.java @@ -57,7 +57,7 @@ public @interface Retryable { Class[] value() default {}; /** - * Applicable exceptions types to attempt a retry for. This attribute + * Applicable exception types to attempt a retry for. This attribute * allows for the convenient specification of assignable exception types. *

The default is empty, leading to a retry attempt for any exception. * @see #excludes() @@ -67,7 +67,7 @@ public @interface Retryable { Class[] includes() default {}; /** - * Non-applicable exceptions types to avoid a retry for. This attribute + * Non-applicable exception types to avoid a retry for. This attribute * allows for the convenient specification of assignable exception types. *

The default is empty, leading to a retry attempt for any exception. * @see #includes() @@ -117,7 +117,7 @@ public @interface Retryable { * A multiplier for a delay for the next retry attempt, applied * to the previous delay (starting with {@link #delay()}) as well * as to the applicable {@link #jitterDelay()} for each attempt. - *

The default is 1.0, effectively leading to a fixed delay. + *

The default is 1.0, effectively resulting in a fixed delay. * @see #delay() * @see #jitterDelay() * @see #maxDelay() @@ -127,7 +127,7 @@ public @interface Retryable { /** * The maximum delay for any retry attempt (in milliseconds), limiting * how far {@link #jitterDelay()} and {@link #delayMultiplier()} can - * increase {@link #delay()}. + * increase the {@linkplain #delay() delay}. *

The default is unlimited. * @see #delay() * @see #jitterDelay() diff --git a/spring-core/src/main/java/org/springframework/util/backoff/ExponentialBackOff.java b/spring-core/src/main/java/org/springframework/util/backoff/ExponentialBackOff.java index 50c79370f0a..72ab4327003 100644 --- a/spring-core/src/main/java/org/springframework/util/backoff/ExponentialBackOff.java +++ b/spring-core/src/main/java/org/springframework/util/backoff/ExponentialBackOff.java @@ -61,25 +61,25 @@ import org.springframework.util.Assert; public class ExponentialBackOff implements BackOff { /** - * The default initial interval: 2000 ms. + * The default initial interval: {@value} ms. */ public static final long DEFAULT_INITIAL_INTERVAL = 2000L; /** - * The default jitter range for each interval: 0 ms. + * The default jitter range for each interval: {@value} ms. * @since 7.0 */ public static final long DEFAULT_JITTER = 0; /** - * The default multiplier (increases the interval by 50%). + * The default multiplier (increases the interval by 50%): {@value}. */ public static final double DEFAULT_MULTIPLIER = 1.5; /** - * The default maximum back-off time: 30000 ms. + * The default maximum back-off time: {@value} ms. */ - public static final long DEFAULT_MAX_INTERVAL = 30000L; + public static final long DEFAULT_MAX_INTERVAL = 30_000L; /** * The default maximum elapsed time: unlimited.