-
Bug
-
Resolution: Done
-
Major
-
JBossAS-4.2.3.GA, JBossAS-5.1.0.GA, 6.0.0.M4
-
None
If you use org.jboss.varia.scheduler.ScheduleManager with short 'period' (say, '1' ms), result of skip repeats calculation can be negative and it causes wrong repetition.
The cause is casting long to int.
public void start() throws JMException
{
Date lStartDate = null;
// Check if initial start date is in the past
if (mStartDate.getTime() < new Date().getTime() && mPeriod > 0)
{
// If then first check if a repetition is in the future
long lNow = new Date().getTime() + 100;
int lSkipRepeats = (int) ((lNow - mStartDate.getTime()) / mPeriod) + 1;
log.debug("Old start date: " + mStartDate + ", now: " + new Date(lNow) + ", Skip repeats: " + lSkipRepeats)
BTW, org.jboss.varia.scheduler.Scheduler properly casts it to long.
- is incorporated by
-
JBPAPP-5009 [JBAS-8382] ScheduleManager's skip repeats can be negative
- Closed
-
JBPAPP-5232 CLONE -[JBAS-8382] ScheduleManager's skip repeats can be negative
- Closed