code: public long getFixedDate(int year, int month, int dayOfMonth, BaseCalendar.Date cache) {
          boolean isJan1 = month == JANUARY && dayOfMonth == 1;
  
          // Look up the one year cache
          if (cache != null && cache.hit(year)) {
              if (isJan1) {
                  return cache.getCachedJan1();
              }
              return cache.getCachedJan1() + getDayOfYear(year, month, dayOfMonth) - 1;
          }
  
          // Look up the pre-calculated fixed date table
          int n = year - BASE_YEAR;
          if (n >= 0 && n < FIXED_DATES.length) {
              long jan1 = FIXED_DATES[n];
              if (cache != null) {
                  cache.setCache(year, jan1, isLeapYear(year) ? 366 : 365);
              }
              return isJan1 ? jan1 : jan1 + getDayOfYear(year, month, dayOfMonth) - 1;
          }
  
          long prevyear = (long)year - 1;
          long days = dayOfMonth;
  
          if (prevyear >= 0) {
              days += (365 * prevyear)
                     + (prevyear / 4)
                     - (prevyear / 100)
                     + (prevyear / 400)
                     + ((367 * month - 362) / 12);
          } else {
              days += (365 * prevyear)
                     + CalendarUtils.floorDivide(prevyear, 4)
                     - CalendarUtils.floorDivide(prevyear, 100)
                     + CalendarUtils.floorDivide(prevyear, 400)
                     + CalendarUtils.floorDivide((367 * month - 362), 12);
          }
  
          if (month > FEBRUARY) {
              days -=  isLeapYear(year) ? 1 : 2;
          }
  
          // If it's January 1, update the cache.
          if (cache != null && isJan1) {
              cache.setCache(year, days, isLeapYear(year) ? 366 : 365);
          }
  
          return days;
      }
docs: public for java.util.GregorianCalendar