Timer with due date set > 24 days in jPDL process definition will cause the timer to be
set in the past
-------------------------------------------------------------------------------------------------------
Key: JBPM-2517
URL:
https://jira.jboss.org/jira/browse/JBPM-2517
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.0
Reporter: Tobias Groothuyse
I have a process with
<time duedate="5 weeks"/>
However when this timer gets instantiated in a running process it's actual duedate
which is calculated is in the past. I traced this bug to the following piece of code:
TimerImpl.class
{code}
} else {
long millis = duration.getMillis() +
1000*( duration.getSeconds() +
60*( duration.getMinutes() +
60*( duration.getHours() +
24*( duration.getDays() +
7*duration.getWeeks()))));
dueDate = new Date(now.getTime() + millis);
}
{code}
Because all the fields from the duration object are of type int, when duration.getDays()
is larger then 24 or a weeks larger than 4 for that matter an int overflow will occur and
long millis will have a negative value.
It is probably best to use the normale calendar operations in all cases to add intervals
to the current systime.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira