Skip to content

Commit

Permalink
Fixed deep copy for infinite Periodic Jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
travolque committed Sep 7, 2017
1 parent 7fa2af6 commit a8234f9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Binary file modified dist/vos_backend.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ public CycleTicker (CycleTicker cycleTicker) throws Exception {

this.initialCycle = cycleTicker.initialCycle;
this.cycleStep = cycleTicker.cycleStep;
this.runFor = new Period(cycleTicker.runFor);

if (cycleTicker.runFor == null) {

this.runFor = null;
} else {

this.runFor = new Period(cycleTicker.runFor);
}
}

/**
Expand Down
12 changes: 10 additions & 2 deletions src/com/vangav/backend/thread_pool/periodic_jobs/PeriodicJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,16 @@ final protected synchronized PeriodicJob<T> getNextPeriodicJob (
(Calendar)this.startCalendar.clone();
getNextPeriodicJob.startTime =
this.startTime;
getNextPeriodicJob.endCalendar =
(Calendar)this.endCalendar.clone();

if (this.endCalendar == null) {

getNextPeriodicJob.endCalendar = null;
} else {

getNextPeriodicJob.endCalendar =
(Calendar)this.endCalendar.clone();
}

getNextPeriodicJob.endTime =
this.endTime;
getNextPeriodicJob.execPeriod =
Expand Down

0 comments on commit a8234f9

Please sign in to comment.