Skip to content

Commit ce4c9eb

Browse files
committed
Polishing
1 parent 7c48013 commit ce4c9eb

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ public boolean isSingletonCurrentlyInCreation(@Nullable String beanName) {
532532

533533
/**
534534
* Callback before singleton creation.
535-
* <p>The default implementation register the singleton as currently in creation.
535+
* <p>The default implementation registers the singleton as currently in creation.
536536
* @param beanName the name of the singleton about to be created
537537
* @see #isSingletonCurrentlyInCreation
538538
*/

spring-core/src/main/java/org/springframework/core/retry/RetryTemplate.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ private void checkIfTimeoutExceeded(long timeout, long startTime, long sleepTime
214214
long elapsedTime = System.currentTimeMillis() + sleepTime - startTime;
215215
if (elapsedTime >= timeout) {
216216
String message = (sleepTime > 0 ? """
217-
Retry policy for operation '%s' would exceed timeout (%d ms) due \
218-
to pending sleep time (%d ms); preemptively aborting execution"""
217+
Retry policy for operation '%s' would exceed timeout (%dms) due \
218+
to pending sleep time (%dms); preemptively aborting execution"""
219219
.formatted(retryable.getName(), timeout, sleepTime) :
220-
"Retry policy for operation '%s' exceeded timeout (%d ms); aborting execution"
220+
"Retry policy for operation '%s' exceeded timeout (%dms); aborting execution"
221221
.formatted(retryable.getName(), timeout));
222222
RetryException retryException = new RetryException(message, exceptions.removeLast());
223223
exceptions.forEach(retryException::addSuppressed);

spring-core/src/test/java/org/springframework/core/retry/RetryTemplateTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ void retryWithTimeoutExceededAfterInitialFailure() throws Exception {
476476
assertThat(invocationCount).hasValue(0);
477477
assertThatExceptionOfType(RetryException.class)
478478
.isThrownBy(() -> retryTemplate.execute(retryable))
479-
.withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(5 ms\\); aborting execution")
479+
.withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(5ms\\); aborting execution")
480480
.withCause(new CustomException("Boom 1"))
481481
.satisfies(throwable -> inOrder.verify(retryListener).onRetryPolicyTimeout(
482482
eq(retryPolicy), eq(retryable), eq(throwable)));
@@ -503,8 +503,8 @@ void retryWithTimeoutExceededAfterFirstDelayButBeforeFirstRetry() throws Excepti
503503
assertThatExceptionOfType(RetryException.class)
504504
.isThrownBy(() -> retryTemplate.execute(retryable))
505505
.withMessageMatching("""
506-
Retry policy for operation '.+?' would exceed timeout \\(5 ms\\) \
507-
due to pending sleep time \\(10 ms\\); preemptively aborting execution\
506+
Retry policy for operation '.+?' would exceed timeout \\(5ms\\) \
507+
due to pending sleep time \\(10ms\\); preemptively aborting execution\
508508
""")
509509
.withCause(new CustomException("Boom 1"))
510510
.satisfies(throwable -> inOrder.verify(retryListener).onRetryPolicyTimeout(
@@ -535,7 +535,7 @@ void retryWithTimeoutExceededAfterFirstRetry() throws Exception {
535535
assertThat(invocationCount).hasValue(0);
536536
assertThatExceptionOfType(RetryException.class)
537537
.isThrownBy(() -> retryTemplate.execute(retryable))
538-
.withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(20 ms\\); aborting execution")
538+
.withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(20ms\\); aborting execution")
539539
.withCause(new CustomException("Boom 2"))
540540
.satisfies(throwable -> {
541541
inOrder.verify(retryListener).beforeRetry(retryPolicy, retryable);
@@ -570,7 +570,7 @@ void retryWithTimeoutExceededAfterSecondRetry() throws Exception {
570570
assertThat(invocationCount).hasValue(0);
571571
assertThatExceptionOfType(RetryException.class)
572572
.isThrownBy(() -> retryTemplate.execute(retryable))
573-
.withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(20 ms\\); aborting execution")
573+
.withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(20ms\\); aborting execution")
574574
.withCause(new CustomException("Boom 3"))
575575
.satisfies(throwable -> {
576576
var counter = new AtomicInteger(1);

0 commit comments

Comments
 (0)