code: private void decodeEndRule() {
          useDaylight = (startDay != 0) && (endDay != 0);
          if (useDaylight && dst == 0) {
              dst = Grego.MILLIS_PER_DAY;
          }
          if (endDay != 0) {
              if (endMonth < Calendar.JANUARY || endMonth > Calendar.DECEMBER) {
                  throw new IllegalArgumentException();
              }
              if (endTime < 0 || endTime > Grego.MILLIS_PER_DAY ||
                  endTimeMode < WALL_TIME || endTimeMode > UTC_TIME) {
                  throw new IllegalArgumentException();
              }
              if (endDayOfWeek == 0) {
                  endMode = DOM_MODE;
              } else {
                  if (endDayOfWeek > 0) {
                      endMode = DOW_IN_MONTH_MODE;
                  } else {
                      endDayOfWeek = -endDayOfWeek;
                      if (endDay > 0) {
                          endMode = DOW_GE_DOM_MODE;
                      } else {
                          endDay = -endDay;
                          endMode = DOW_LE_DOM_MODE;
                      }
                  }
                  if (endDayOfWeek > Calendar.SATURDAY) {
                      throw new IllegalArgumentException();
                  }
              }
              if (endMode == DOW_IN_MONTH_MODE) {
                  if (endDay < -5 || endDay > 5) {
                      throw new IllegalArgumentException();
                  }
              } else if (endDay<1 || endDay > staticMonthLength[endMonth]) {
                  throw new IllegalArgumentException();
              }
          }
      }
docs: Decode the end rule and validate the parameters.  This method is exactly
  analogous to decodeStartRule().
  @see #decodeStartRule