mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

abobrov
16.13.2009 496a2e38f75326d4ebf5363621b9e6e2a9077b2a
- [Issues 3842/3770] validate recurring task day against the actual maximum of a given calendar instance.
2 files modified
10 ■■■■■ changed files
opends/src/server/org/opends/server/backends/task/RecurringTask.java 4 ●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/backends/task/TaskBackendTestCase.java 6 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/backends/task/RecurringTask.java
@@ -640,7 +640,9 @@
          }
          day = getNextTimeSlice(daysArray,
            calendar.get(GregorianCalendar.DAY_OF_MONTH));
          if (day == -1) {
          if ((day == -1) || (day > calendar.getActualMaximum(
                              GregorianCalendar.DAY_OF_MONTH)))
          {
            calendar.set(GregorianCalendar.DAY_OF_MONTH, 1);
            calendar.add(GregorianCalendar.MONTH, 1);
          } else {
opends/tests/unit-tests-testng/src/server/org/opends/server/backends/task/TaskBackendTestCase.java
@@ -453,10 +453,10 @@
        { "* 0 * * *",     true },
        { "* 0-23 * * *",  true },
        { "* 0,23 * * *",  true },
        // { "* * 31 * *",    true }, *** FIXME: this should work ***
        { "* * 31 * *",    true },
        { "* * 1 * *",     true },
        { "* * 1-31 * *",  true },
        // { "* * 1,31 * *",  true }, *** FIXME: this should work ***
        { "* * 1,31 * *",  true },
        { "* * * 12 *",    true },
        { "* * * 1 *",     true },
        { "* * * 1-12 *",  true },
@@ -464,7 +464,7 @@
        { "* * * * 6",     true },
        { "* * * * 0",     true },
        { "* * * * 0-6",   true },
        { "* * * * 0,6",   true },
        { "* * * * 0,6",   true }
    };
  }