Polishing

See gh-35460
This commit is contained in:
Juergen Hoeller
2025-10-11 15:11:16 +02:00
parent 83efe8cff4
commit 467a484df6
@@ -22,9 +22,7 @@ import org.springframework.util.Assert;
/**
* {@link TaskExecutor} implementation that executes each task <i>synchronously</i>
* in the calling thread.
*
* <p>Mainly intended for testing scenarios.
* in the calling thread. Mainly intended for testing scenarios.
*
* <p>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();
}