case HOUR_OF_DAY1_FIELD: withLeadingZeros(theCalendar.get(Calendar.HOUR),p.size,buffer);
case HOUR_OF_DAY1_FIELD: withLeadingZeros(((theCalendar.get(Calendar.HOUR_OF_DAY)+23)%24)+1,p.size,buffer);
  public StringBuffer format(Date date, StringBuffer buffer, FieldPosition pos) {    String temp;    Calendar theCalendar = (Calendar) calendar.clone();    theCalendar.setTime(date);        // go through vector, filling in fields where applicable, else toString    Enumeration e = tokens.elements();    while (e.hasMoreElements()) {      Object o = e.nextElement();      if (o instanceof FieldSizePair) {	FieldSizePair p = (FieldSizePair) o;	int beginIndex = buffer.length();	switch (p.field) {	case ERA_FIELD:	  buffer.append(formatData.eras[theCalendar.get(Calendar.ERA)]);	  break;	case YEAR_FIELD:	  temp = String.valueOf(theCalendar.get(Calendar.YEAR));	  if (p.size < 4)	    buffer.append(temp.substring(temp.length()-2));	  else	    buffer.append(temp);	  break;	case MONTH_FIELD:	  if (p.size < 3)	    withLeadingZeros(theCalendar.get(Calendar.MONTH)+1,p.size,buffer);	  else if (p.size < 4)	    buffer.append(formatData.shortMonths[theCalendar.get(Calendar.MONTH)]);	  else	    buffer.append(formatData.months[theCalendar.get(Calendar.MONTH)]);	  break;	case DATE_FIELD:	  withLeadingZeros(theCalendar.get(Calendar.DATE),p.size,buffer);	  break;	case HOUR_OF_DAY1_FIELD:  // 1-12	  withLeadingZeros(theCalendar.get(Calendar.HOUR),p.size,buffer);	  break;	case HOUR_OF_DAY0_FIELD: // 0-23	  withLeadingZeros(theCalendar.get(Calendar.HOUR_OF_DAY),p.size,buffer);	  break;	case MINUTE_FIELD:	  withLeadingZeros(theCalendar.get(Calendar.MINUTE),p.size,buffer);	  break;	case SECOND_FIELD:	  withLeadingZeros(theCalendar.get(Calendar.SECOND),p.size,buffer);	  break;	case MILLISECOND_FIELD:	  withLeadingZeros(theCalendar.get(Calendar.MILLISECOND),p.size,buffer);	  break;	case DAY_OF_WEEK_FIELD:	  if (p.size < 4)	    buffer.append(formatData.shortWeekdays[theCalendar.get(Calendar.DAY_OF_WEEK)]);	  else	    buffer.append(formatData.weekdays[theCalendar.get(Calendar.DAY_OF_WEEK)]);	  break;	case DAY_OF_YEAR_FIELD:	  withLeadingZeros(theCalendar.get(Calendar.DAY_OF_YEAR),p.size,buffer);	  break;	case DAY_OF_WEEK_IN_MONTH_FIELD:	  withLeadingZeros(theCalendar.get(Calendar.DAY_OF_WEEK_IN_MONTH),p.size,buffer);	  break;	case WEEK_OF_YEAR_FIELD:	  withLeadingZeros(theCalendar.get(Calendar.WEEK_OF_YEAR),p.size,buffer);	  break;	case WEEK_OF_MONTH_FIELD:	  withLeadingZeros(theCalendar.get(Calendar.WEEK_OF_MONTH),p.size,buffer);	  break;	case AM_PM_FIELD:	  buffer.append(formatData.ampms[theCalendar.get(Calendar.AM_PM)]);	  break;	case HOUR1_FIELD: // 1-24	  withLeadingZeros(theCalendar.get(Calendar.HOUR_OF_DAY)+1,p.size,buffer);	  break;	case HOUR0_FIELD: // 0-11	  withLeadingZeros(theCalendar.get(Calendar.HOUR)-1,p.size,buffer);	  break;	case TIMEZONE_FIELD:	  TimeZone zone = theCalendar.getTimeZone();	  boolean isDST = theCalendar.get(Calendar.DST_OFFSET) != 0;	  // FIXME: XXX: This should be a localized time zone.	  String zoneID = zone.getDisplayName(isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT);	  buffer.append(zoneID);	  break;	default:	  throw new IllegalArgumentException("Illegal pattern character");	}	if (pos != null && p.field == pos.getField())	  {	    pos.setBeginIndex(beginIndex);	    pos.setEndIndex(buffer.length());	  }      } else {	buffer.append(o.toString());      }    }    return buffer;  }