Skip to content

Commit 97b0177

Browse files
committed
TimerScheduledFuture correctly calculates getDelay result
Issue: SPR-13977 (cherry picked from commit a68b910)
1 parent 9f2b3ca commit 97b0177

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.
@@ -134,7 +134,7 @@ public boolean cancel(boolean mayInterruptIfRunning) {
134134

135135
@Override
136136
public long getDelay(TimeUnit unit) {
137-
return unit.convert(System.currentTimeMillis() - this.timer.getScheduledExecutionTime(), TimeUnit.MILLISECONDS);
137+
return unit.convert(this.timer.getScheduledExecutionTime() - System.currentTimeMillis(), TimeUnit.MILLISECONDS);
138138
}
139139

140140
@Override

0 commit comments

Comments
 (0)