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

Temporal expressions sometimes incorrectly calculate next occurrence

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • framework
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: