|
|
|
[
Permlink
| « Hide
]
James House - [01/May/07 12:57 PM ]
Yikes!
Attaching a unit test showing this problem.
The fix seems easy enough, and I'll attach a patch for this:
public void setCronExpression(String cronExpression) throws ParseException { TimeZone tmp = getTimeZone(); this.cronEx = new CronExpression(cronExpression); this.cronEx.setTimeZone(tmp); } Chatting on dev@, James suggests the following avenues of investigation:
* Remove the timezone variable from CronTrigger; delegate all timezone work into the CronExpression. * Make sure serialization is happy with the variable removal. Possibly need to include the cronExpression's timezone in the serialization. * Make sure to do: public void setCronExpression(String cronExpression) throws ParseException { TimeZone otz = this.cronEx.getTimeZone(); this.cronEx = new CronExpression(cronExpression); this.cronEx.setTimeZone(otz); } ie) if a String expression pased in, then use the current timezone. * Investigate CronCalendar; it has the same problems. In studying the problem out futher.... due to the fact that CronTrigger.setTimeZone() has existed for years, and there is a lot of code calling it, we cannot really take the improvements so far as to remove the timezone property from CronTrigger. Thus the immediate problem reported as part of the bug (not preserving the timezone when the cron expression is changed) has been fixed as originally proposed. | ||||||||||||||||||||||||||||||||||||||||||||||||