File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
spring-core/src/main/java/org/springframework/util/backoff Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -200,8 +200,7 @@ private long computeNextInterval() {
200
200
}
201
201
else if (this .currentInterval < 0 ) {
202
202
long initialInterval = getInitialInterval ();
203
- this .currentInterval = (initialInterval < maxInterval
204
- ? initialInterval : maxInterval );
203
+ this .currentInterval = Math .min (initialInterval , maxInterval );
205
204
}
206
205
else {
207
206
this .currentInterval = multiplyInterval (maxInterval );
@@ -212,7 +211,7 @@ else if (this.currentInterval < 0) {
212
211
private long multiplyInterval (long maxInterval ) {
213
212
long i = this .currentInterval ;
214
213
i *= getMultiplier ();
215
- return ( i > maxInterval ? maxInterval : i );
214
+ return Math . min ( i , maxInterval );
216
215
}
217
216
218
217
You can’t perform that action at this time.
0 commit comments