From 467a484df6ff6035df69e81eeee5b4d91f15f8dd Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sat, 11 Oct 2025 15:11:16 +0200 Subject: [PATCH] Polishing See gh-35460 --- .../springframework/core/task/SyncTaskExecutor.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/task/SyncTaskExecutor.java b/spring-core/src/main/java/org/springframework/core/task/SyncTaskExecutor.java index a56f7bd922a..a0c47048da5 100644 --- a/spring-core/src/main/java/org/springframework/core/task/SyncTaskExecutor.java +++ b/spring-core/src/main/java/org/springframework/core/task/SyncTaskExecutor.java @@ -22,9 +22,7 @@ import org.springframework.util.Assert; /** * {@link TaskExecutor} implementation that executes each task synchronously - * in the calling thread. - * - *

Mainly intended for testing scenarios. + * in the calling thread. Mainly intended for testing scenarios. * *

Execution in the calling thread does have the advantage of participating * in its thread context, for example the thread context class loader or the @@ -40,13 +38,13 @@ import org.springframework.util.Assert; public class SyncTaskExecutor implements TaskExecutor, Serializable { /** - * Executes the given {@code task} synchronously, through direct - * invocation of it's {@link Runnable#run() run()} method. - * @throws IllegalArgumentException if the given {@code task} is {@code null} + * Execute the given {@code task} synchronously, through direct + * invocation of its {@link Runnable#run() run()} method. + * @throws RuntimeException if propagated from the given {@code Runnable} */ @Override public void execute(Runnable task) { - Assert.notNull(task, "Runnable must not be null"); + Assert.notNull(task, "Task must not be null"); task.run(); }