From d8729a7c67be34f78ec7352992d5933c8ca9bc8b Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Wed, 28 Jun 2023 10:10:53 +0800 Subject: [PATCH] Polish variable name in ReschedulingRunnable As a variable name, `initDelay` is applicable for `scheduleAtFixedRate` and `scheduleWithFixedDelay` but not for `schedule`. Closes gh-30762 --- .../scheduling/concurrent/ReschedulingRunnable.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ReschedulingRunnable.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ReschedulingRunnable.java index 10fbaaab23..c14be23fd5 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ReschedulingRunnable.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ReschedulingRunnable.java @@ -79,8 +79,8 @@ class ReschedulingRunnable extends DelegatingErrorHandlingRunnable implements Sc if (this.scheduledExecutionTime == null) { return null; } - Duration initialDelay = Duration.between(this.triggerContext.getClock().instant(), this.scheduledExecutionTime); - this.currentFuture = this.executor.schedule(this, initialDelay.toNanos(), TimeUnit.NANOSECONDS); + Duration delay = Duration.between(this.triggerContext.getClock().instant(), this.scheduledExecutionTime); + this.currentFuture = this.executor.schedule(this, delay.toNanos(), TimeUnit.NANOSECONDS); return this; } }