docs: private boolean advanceDayIfNeeded(Calendar cal)
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
  
          // Try all of the different mechanisms for matching a day, but only if
          // they are not wild cards.  If one of the "getNext" methods returns
          // the current day, then we are done.  Otherwise, each method will
          // have returned the nearest day of the current month that would
          // satisfy the constraint, or a number >= the last day of the month to
          // indicate there are no matching days this month.  The
          // ADVANCE_TO_NEXT_MONTH constant is defined for convenience.
  
          int day = cal.get(Calendar.DAY_OF_MONTH) - 1;
          int nextDay = Integer.MAX_VALUE;
  
          if (daysOfMonth != WILD_CARD)
          {
              int result = getNextDayOfMonth(day);
  
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "next dayOfMonth = " + result);
  
              if (result == day)
              {
                  return false;
              }
  
              nextDay = Math.min(nextDay, result);
          }
  
          int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH) - 1;
  
          if (lastDaysOfMonth != WILD_CARD)
          {
              int result = getNextLastDayOfMonth(day, lastDay);
  
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "next lastDayOfMonth = " + result);
  
              if (result == day)
              {
                  return false;
              }
  
              nextDay = Math.min(nextDay, result);
          }
  
          int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK) - 1;
  
          if (daysOfWeek != WILD_CARD)
          {
              int result = getNextDayOfWeek(day, dayOfWeek);
  
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "next daysOfWeek = " + result);
  
              if (result == day)
              {
                  return false;
              }
  
              nextDay = Math.min(nextDay, result);
          }
  
          if (daysOfWeekInMonth != WILD_CARD)
          {
              int result = getNextDayOfWeekInMonth(day, lastDay, dayOfWeek);
  
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "daysOfWeekInMonth includes " + result);
  
              if (result == day)
              {
                  return false;
              }
  
              nextDay = Math.min(nextDay, result);
          }
  
          if (lastDaysOfWeekInMonth != WILD_CARD)
          {
              int result = getNextLastDayOfWeekInMonth(day, lastDay, dayOfWeek);
  
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "next lastDaysOfWeekInMonth = " + result);
  
              if (result == day)
              {
                  return false;
              }
  
              nextDay = Math.min(nextDay, result);
          }
  
          if (variableDayOfMonthRanges != null) // d659945
          {
              int result = getNextVariableDay(day, lastDay, dayOfWeek);
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                  Tr.debug(tc, "next variableDayOfMonthRanges = " + result);
  
              if (result == day)
              {
                  return false;
              }
  
              nextDay = Math.min(nextDay, result);
          }
  
          if (nextDay == Integer.MAX_VALUE)
          {
              // No day constraints are specified for this expression.
              return false;
          }
  
          // d659945.1 - Reset fields using firstOfWildCard.
          cal.set(Calendar.SECOND, firstOfWildCard(seconds));
          cal.set(Calendar.MINUTE, firstOfWildCard(minutes));
          cal.set(Calendar.HOUR_OF_DAY, firstOfWildCard(hours));
  
          if (nextDay <= lastDay)
          {
              // A constraint matched a day within the current month.
              cal.set(Calendar.DAY_OF_MONTH, nextDay + 1);
          }
          else
          {
              // There were no matches for the rest of the days in the current
              // month.  Advance to the next month and try again.
              cal.set(Calendar.DAY_OF_MONTH, 1);
              cal.add(Calendar.MONTH, 1);
          }
  
          return true;
      }