Skip to content

Commit 4fe386d

Browse files
committed
TimerScheduledFuture correctly calculates getDelay result
Issue: SPR-13977 (cherry picked from commit 97b0177)
1 parent ad10301 commit 4fe386d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-context-support/src/main/java/org/springframework/scheduling/commonj/TimerManagerTaskScheduler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -126,7 +126,7 @@ public boolean cancel(boolean mayInterruptIfRunning) {
126126
}
127127

128128
public long getDelay(TimeUnit unit) {
129-
return unit.convert(System.currentTimeMillis() - this.timer.getScheduledExecutionTime(), TimeUnit.MILLISECONDS);
129+
return unit.convert(this.timer.getScheduledExecutionTime() - System.currentTimeMillis(), TimeUnit.MILLISECONDS);
130130
}
131131

132132
public int compareTo(Delayed other) {

0 commit comments

Comments
 (0)