ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Gray (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OFBIZ-10875) Temporal expressions sometimes incorrectly calculate next occurrence
Date Wed, 27 Mar 2019 03:28:00 GMT
Scott Gray created OFBIZ-10875:

             Summary: Temporal expressions sometimes incorrectly calculate next occurrence
                 Key: OFBIZ-10875
                 URL: https://issues.apache.org/jira/browse/OFBIZ-10875
             Project: OFBiz
          Issue Type: Bug
          Components: framework
            Reporter: Scott Gray

I've noticed that temporal expressions that involve the last hour of a day incorrectly calculate
the next occurrence, effectively skipping the "real" next occurrence and ending up on the
one following that.

This appears to occur because MinuteRange.next() does not check if the day has been "bumped"
(ExpressionContext.dayBumped) once it has finished incrementing the calendar to find the next
minute in the expression range.  It checks if the hour has been bumped but not day or month.

The following expression can reproduce the issue:
Intersection [11PM_MON_FRI]:
  MinuteRange [MINUTE_00], start = 00, end = 00
  HourRange [HOUR_23], start = 23, end = 23
  DayOfWeekRange [MON_TO_FRI], start = 2, end = 6
When next() is called using 2019-03-26 23:00:00.0
the method will respond with 2019-03-28 23:00:00.0
instead of the expected 2019-03-27 23:00:00.0

Effectively means the above expression would provide every second weekday instead of every

This message was sent by Atlassian JIRA

View raw message