Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-10875

Temporal expressions sometimes incorrectly calculate next occurrence

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Upcoming Branch
    • Component/s: framework
    • Labels:
      None

      Description

      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 weekday.

        Attachments

          Activity

            People

            • Assignee:
              lektran Scott Gray
              Reporter:
              lektran Scott Gray
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: