Polishing

(cherry picked from commit d0b186a1c7)
This commit is contained in:
Juergen Hoeller
2025-04-28 16:13:04 +02:00
parent 71f2725638
commit a5b0399a1d
2 changed files with 7 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2024 the original author or authors. * Copyright 2002-2025 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -85,6 +85,7 @@ public class ExponentialBackOff implements BackOff {
*/ */
public static final int DEFAULT_MAX_ATTEMPTS = Integer.MAX_VALUE; public static final int DEFAULT_MAX_ATTEMPTS = Integer.MAX_VALUE;
private long initialInterval = DEFAULT_INITIAL_INTERVAL; private long initialInterval = DEFAULT_INITIAL_INTERVAL;
private double multiplier = DEFAULT_MULTIPLIER; private double multiplier = DEFAULT_MULTIPLIER;
@@ -204,6 +205,7 @@ public class ExponentialBackOff implements BackOff {
return this.maxAttempts; return this.maxAttempts;
} }
@Override @Override
public BackOffExecution start() { public BackOffExecution start() {
return new ExponentialBackOffExecution(); return new ExponentialBackOffExecution();
@@ -225,6 +227,7 @@ public class ExponentialBackOff implements BackOff {
.toString(); .toString();
} }
private class ExponentialBackOffExecution implements BackOffExecution { private class ExponentialBackOffExecution implements BackOffExecution {
private long currentInterval = -1; private long currentInterval = -1;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2025 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@ public class FixedBackOff implements BackOff {
*/ */
public static final long UNLIMITED_ATTEMPTS = Long.MAX_VALUE; public static final long UNLIMITED_ATTEMPTS = Long.MAX_VALUE;
private long interval = DEFAULT_INTERVAL; private long interval = DEFAULT_INTERVAL;
private long maxAttempts = UNLIMITED_ATTEMPTS; private long maxAttempts = UNLIMITED_ATTEMPTS;
@@ -86,6 +87,7 @@ public class FixedBackOff implements BackOff {
return this.maxAttempts; return this.maxAttempts;
} }
@Override @Override
public BackOffExecution start() { public BackOffExecution start() {
return new FixedBackOffExecution(); return new FixedBackOffExecution();