From 96f03990723d7499b95d96126645cdd30a36ea38 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sat, 28 Jun 2025 12:11:02 +0200 Subject: [PATCH] Reintroduce FixedBackOff(long) constructor Effectively removing FixedBackOff(Duration) only. See gh-35028 See gh-35110 --- .../springframework/util/backoff/FixedBackOff.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spring-core/src/main/java/org/springframework/util/backoff/FixedBackOff.java b/spring-core/src/main/java/org/springframework/util/backoff/FixedBackOff.java index b75522857d..e3197062b5 100644 --- a/spring-core/src/main/java/org/springframework/util/backoff/FixedBackOff.java +++ b/spring-core/src/main/java/org/springframework/util/backoff/FixedBackOff.java @@ -21,6 +21,7 @@ package org.springframework.util.backoff; * between two attempts and a maximum number of retries. * * @author Stephane Nicoll + * @author Sam Brannen * @since 4.1 */ public class FixedBackOff implements BackOff { @@ -50,6 +51,17 @@ public class FixedBackOff implements BackOff { public FixedBackOff() { } + /** + * Create an instance with the supplied interval and an unlimited number of + * attempts. + * @param interval the interval between two attempts in milliseconds + * @since 7.0 + * @see #setMaxAttempts(long) + */ + public FixedBackOff(long interval) { + this.interval = interval; + } + /** * Create an instance with the supplied interval and maximum number of attempts. * @param interval the interval between two attempts in milliseconds