[
http://jira.jboss.com/jira/browse/JBPM-1137?page=all ]
Alejandro Guizar updated JBPM-1137:
-----------------------------------
Assignee: JBoss QA Lead (was: Alejandro Guizar)
Status: QA In Progress (was: Coding In Progress)
Patch Instructions:
PATCH NAME:
JBPM-1137
PRODUCT NAME:
JBoss jBPM
VERSION:
3.2.2
SHORT DESCRIPTION:
Date calculations are now delegated to java.util.Calendar whenever
possible
LONG DESCRIPTION:
Before, date calculations assumed months and years were exactly 30 and
365 days long respectively. With this fix, the actual durations of
concrete months and years will be taken into account. This is because
addition of durations to time instants will be delegated to the
java.util.Calendar class.
MANUAL INSTALL INSTRUCTIONS:
Copy jbpm-jpdl.jar to <jbpm-home>/
Add jbpm-jpdl.jar to <jbpm-home>/deploy/jbpm-console.war under WEB-INF/lib/
Add jbpm-jpdl.jar to <jbpm-home>deploy/jbpm-enterprise.ear under lib/
COMPATIBILITY:
no known issues
DEPENDENCIES:
none
SUPERSEDES:
none
SUPERSEDED BY:
none
CREATOR:
Alejandro Guizar
DATE:
3 Mar 2008
Leap Year Date Calculations
---------------------------
Key: JBPM-1137
URL:
http://jira.jboss.com/jira/browse/JBPM-1137
Project: JBoss jBPM
Issue Type: Support Patch
Components: Core Engine
Affects Versions: jBPM jPDL 3.2.2
Reporter: Alejandro Guizar
Assigned To: JBoss QA Lead
Attachments: jbpm-jpdl.jar
Based on JBPM-1098 there is concern over date calculations in in jBPM 3.1 and 3.2. There
might be issues around the end of Feb.
Durations that are not expressed in months or years work correctly under the current
model. Consider the following expression.
endDate = new Date(startDate.getTime() + interval);
If startDate is February 28, 2008 and interval is 1 day, then endDate will be February
29, 2008. Every day has the same duration even on leap years.
The presentation layer is responsible of converting the milliseconds in a Date to a
suitable representation in the calendar system. The Java APIs are all aware of leap years,
so this is covered as well.
The situation is different for months and years. If the interval above was 1 year, then
endDate would be February 27, 2009. Because of the extra day in 2008, the expected endDate
has shifted backwards one day.
To fix this, our Duration class has to preserve the original unit of time instead of
converting to milliseconds up front. Then we can do the following.
startCalendar = Calendar.getInstance();
startCalendar.setTime(startDate);
startCalendar.add(unit, interval);
endDate = startCalendar.getTime();
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira