if (startDayOfWeek == 0) startMode = DOM_MODE; else
int daysInMonth = getDaysInMonth(month, 1); if (dayOfWeek == 0)
  private int checkRule(int month)  {    if (startDay != 0)      {        if (startMonth < 0 || startMonth > 11)      throw new IllegalArgumentException("month out of range");        if (startDayOfWeek == 0)          startMode = DOM_MODE;        else      {            if (startDayOfWeek > 0)              startMode = DOW_IN_MONTH_MODE;            else      {                startDayOfWeek = -startDayOfWeek;                if (startDay < 0)                  {                    startDay = - startDay;                    startMode = DOW_LE_DOM_MODE;      }    else                  startMode = DOW_GE_DOM_MODE;              }            if (startDayOfWeek > Calendar.SATURDAY)              throw new IllegalArgumentException("day of week out of range");          }        if (startMode != DOW_IN_MONTH_MODE            && (startDay <= 0 || startDay > getDaysInMonth(month, 1)))	  throw new IllegalArgumentException("day out of range");      }    return startMode;  }