Skip to content

Commit

Permalink
Fixed issue with Timer.schedule(TimerTask,Date,long) and Timer.schedu…
Browse files Browse the repository at this point in the history
…leAtFixedRate(TimerTask,Date,long) not setting the delay properly. #3580
  • Loading branch information
shannah committed May 6, 2022
1 parent 65f41c6 commit bd7e574
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vm/JavaAPI/src/java/util/Timer.java
Expand Up @@ -40,7 +40,7 @@ public void schedule(TimerTask task, Date time) {
}

public void schedule(TimerTask task, Date firstTime, long period) {
task.initialDelay = firstTime.getTime();
task.initialDelay = firstTime.getTime() - System.currentTimeMillis();
task.repeatDelay = period;
T t = new T();
t.task = task;
Expand All @@ -63,7 +63,7 @@ public void schedule(TimerTask task, long delay, long period) {
}

public void scheduleAtFixedRate(TimerTask task, Date firstTime, long period) {
task.initialDelay = firstTime.getTime();
task.initialDelay = firstTime.getTime() - System.currentTimeMillis();
task.repeatDelay = period;
T t = new T();
t.task = task;
Expand Down

0 comments on commit bd7e574

Please sign in to comment.