fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 12) / 7;
fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 6) / 7;
  protected synchronized void computeFields()  {    boolean gregorian = (time >= gregorianCutover);    TimeZone zone = getTimeZone();    fields[ZONE_OFFSET] = zone.getRawOffset();    long localTime = time + fields[ZONE_OFFSET];    int day = (int) (localTime / (24 * 60 * 60 * 1000L));    int millisInDay = (int) (localTime % (24 * 60 * 60 * 1000L));    if (millisInDay < 0)      {	millisInDay += (24 * 60 * 60 * 1000);	day--;      }    calculateDay(day, gregorian);    fields[DST_OFFSET] =      zone.getOffset(fields[ERA], fields[YEAR], fields[MONTH],		     fields[DAY_OF_MONTH], fields[DAY_OF_WEEK],		     millisInDay) - fields[ZONE_OFFSET];    millisInDay += fields[DST_OFFSET];    if (millisInDay >= 24 * 60 * 60 * 1000)      {	millisInDay -= 24 * 60 * 60 * 1000;	calculateDay(++day, gregorian);      }    fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 12) / 7;    // which day of the week are we (0..6), relative to getFirstDayOfWeek    int relativeWeekday = (7 + fields[DAY_OF_WEEK] - getFirstDayOfWeek()) % 7;    fields[WEEK_OF_MONTH] = (fields[DAY_OF_MONTH] - relativeWeekday + 12) / 7;    int weekOfYear = (fields[DAY_OF_YEAR] - relativeWeekday + 6) / 7;    // Do the Correction: getMinimalDaysInFirstWeek() is always in the     // first week.    int minDays = getMinimalDaysInFirstWeek();    int firstWeekday =      (7 + getWeekDay(fields[YEAR], minDays) - getFirstDayOfWeek()) % 7;    if (minDays - firstWeekday < 1)      weekOfYear++;    fields[WEEK_OF_YEAR] = weekOfYear;    int hourOfDay = millisInDay / (60 * 60 * 1000);    fields[AM_PM] = (hourOfDay < 12) ? AM : PM;    int hour = hourOfDay % 12;    fields[HOUR] = (hour == 0) ? 12 : hour;    fields[HOUR_OF_DAY] = hourOfDay;    millisInDay %= (60 * 60 * 1000);    fields[MINUTE] = millisInDay / (60 * 1000);    millisInDay %= (60 * 1000);    fields[SECOND] = millisInDay / (1000);    fields[MILLISECOND] = millisInDay % 1000;    areFieldsSet = isSet[ERA] = isSet[YEAR] = isSet[MONTH] =      isSet[WEEK_OF_YEAR] = isSet[WEEK_OF_MONTH] =      isSet[DAY_OF_MONTH] = isSet[DAY_OF_YEAR] = isSet[DAY_OF_WEEK] =      isSet[DAY_OF_WEEK_IN_MONTH] = isSet[AM_PM] = isSet[HOUR] =      isSet[HOUR_OF_DAY] = isSet[MINUTE] = isSet[SECOND] =      isSet[MILLISECOND] = isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true;  }