From ce4c9ebe3c7549bd71df86fc1df7ab1d5c8c2ab3 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 10 Dec 2025 12:31:26 +0100 Subject: [PATCH] Polishing --- .../factory/support/DefaultSingletonBeanRegistry.java | 2 +- .../org/springframework/core/retry/RetryTemplate.java | 6 +++--- .../springframework/core/retry/RetryTemplateTests.java | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java index fd069e83d73..f3491647b4f 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java @@ -532,7 +532,7 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements /** * Callback before singleton creation. - *
The default implementation register the singleton as currently in creation. + *
The default implementation registers the singleton as currently in creation. * @param beanName the name of the singleton about to be created * @see #isSingletonCurrentlyInCreation */ diff --git a/spring-core/src/main/java/org/springframework/core/retry/RetryTemplate.java b/spring-core/src/main/java/org/springframework/core/retry/RetryTemplate.java index c0f5163a45b..fa7bcff596f 100644 --- a/spring-core/src/main/java/org/springframework/core/retry/RetryTemplate.java +++ b/spring-core/src/main/java/org/springframework/core/retry/RetryTemplate.java @@ -214,10 +214,10 @@ public class RetryTemplate implements RetryOperations { long elapsedTime = System.currentTimeMillis() + sleepTime - startTime; if (elapsedTime >= timeout) { String message = (sleepTime > 0 ? """ - Retry policy for operation '%s' would exceed timeout (%d ms) due \ - to pending sleep time (%d ms); preemptively aborting execution""" + Retry policy for operation '%s' would exceed timeout (%dms) due \ + to pending sleep time (%dms); preemptively aborting execution""" .formatted(retryable.getName(), timeout, sleepTime) : - "Retry policy for operation '%s' exceeded timeout (%d ms); aborting execution" + "Retry policy for operation '%s' exceeded timeout (%dms); aborting execution" .formatted(retryable.getName(), timeout)); RetryException retryException = new RetryException(message, exceptions.removeLast()); exceptions.forEach(retryException::addSuppressed); diff --git a/spring-core/src/test/java/org/springframework/core/retry/RetryTemplateTests.java b/spring-core/src/test/java/org/springframework/core/retry/RetryTemplateTests.java index e4fcd68e007..f5af910958e 100644 --- a/spring-core/src/test/java/org/springframework/core/retry/RetryTemplateTests.java +++ b/spring-core/src/test/java/org/springframework/core/retry/RetryTemplateTests.java @@ -476,7 +476,7 @@ class RetryTemplateTests { assertThat(invocationCount).hasValue(0); assertThatExceptionOfType(RetryException.class) .isThrownBy(() -> retryTemplate.execute(retryable)) - .withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(5 ms\\); aborting execution") + .withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(5ms\\); aborting execution") .withCause(new CustomException("Boom 1")) .satisfies(throwable -> inOrder.verify(retryListener).onRetryPolicyTimeout( eq(retryPolicy), eq(retryable), eq(throwable))); @@ -503,8 +503,8 @@ class RetryTemplateTests { assertThatExceptionOfType(RetryException.class) .isThrownBy(() -> retryTemplate.execute(retryable)) .withMessageMatching(""" - Retry policy for operation '.+?' would exceed timeout \\(5 ms\\) \ - due to pending sleep time \\(10 ms\\); preemptively aborting execution\ + Retry policy for operation '.+?' would exceed timeout \\(5ms\\) \ + due to pending sleep time \\(10ms\\); preemptively aborting execution\ """) .withCause(new CustomException("Boom 1")) .satisfies(throwable -> inOrder.verify(retryListener).onRetryPolicyTimeout( @@ -535,7 +535,7 @@ class RetryTemplateTests { assertThat(invocationCount).hasValue(0); assertThatExceptionOfType(RetryException.class) .isThrownBy(() -> retryTemplate.execute(retryable)) - .withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(20 ms\\); aborting execution") + .withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(20ms\\); aborting execution") .withCause(new CustomException("Boom 2")) .satisfies(throwable -> { inOrder.verify(retryListener).beforeRetry(retryPolicy, retryable); @@ -570,7 +570,7 @@ class RetryTemplateTests { assertThat(invocationCount).hasValue(0); assertThatExceptionOfType(RetryException.class) .isThrownBy(() -> retryTemplate.execute(retryable)) - .withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(20 ms\\); aborting execution") + .withMessageMatching("Retry policy for operation '.+?' exceeded timeout \\(20ms\\); aborting execution") .withCause(new CustomException("Boom 3")) .satisfies(throwable -> { var counter = new AtomicInteger(1);