Program: 72633
Project: 72633
Buggy source:
/** 
 * Construct a date token with all tokens present. If a token for the long value is present, use this token and time zone as well as precision. Otherwise use tokens on other inputs to create ports.
 * @exception IllegalActionException If there is no director.
 */
@Override public void fire() throws IllegalActionException {
  super.fire();
  DateToken dateToken=null;
  int datePrecision=DateToken.PRECISION_MILLISECOND;
  if (timeInMillis.connectedPortList().size() > 0 && timeInMillis.hasToken(0)) {
    long timeAsLongValue=1l;
    timeAsLongValue=((LongToken)timeInMillis.get(0)).longValue();
    String precisionValue="String_Node_Str";
    precisionValue=((StringToken)precision.getToken()).stringValue();
    if (precisionValue.equals("String_Node_Str")) {
      datePrecision=DateToken.PRECISION_SECOND;
    }
    if (precisionValue.equals("String_Node_Str")) {
      datePrecision=DateToken.PRECISION_MILLISECOND;
    }
    if (precisionValue.equals("String_Node_Str")) {
      datePrecision=DateToken.PRECISION_MICROSECOND;
    }
    if (precisionValue.equals("String_Node_Str")) {
      datePrecision=DateToken.PRECISION_NANOSECOND;
    }
 else {
      datePrecision=DateToken.PRECISION_MILLISECOND;
    }
    String timeZoneValue=TimeZone.getDefault().getID();
    if ((timeZone.connectedPortList().size() > 0) && timeZone.hasToken(0)) {
      timeZoneValue=((StringToken)timeZone.get(0)).stringValue();
    }
    dateToken=new DateToken(timeAsLongValue,datePrecision,TimeZone.getTimeZone(timeZoneValue));
  }
 else {
    int yearValue=1970;
    if (year.connectedPortList().size() > 0 && year.hasToken(0)) {
      yearValue=((IntToken)year.get(0)).intValue();
    }
    int monthValue=1;
    if (month.connectedPortList().size() > 0 && month.hasToken(0)) {
      monthValue=((IntToken)month.get(0)).intValue();
    }
    int dayValue=1;
    if (day.connectedPortList().size() > 0 && day.hasToken(0)) {
      dayValue=((IntToken)day.get(0)).intValue();
    }
    int hourValue=0;
    if (hour.connectedPortList().size() > 0 && hour.hasToken(0)) {
      hourValue=((IntToken)hour.get(0)).intValue();
    }
    int minuteValue=0;
    if (minute.connectedPortList().size() > 0 && minute.hasToken(0)) {
      minuteValue=((IntToken)minute.get(0)).intValue();
    }
    int secondValue=0;
    if (second.connectedPortList().size() > 0 && second.hasToken(0)) {
      secondValue=((IntToken)second.get(0)).intValue();
      datePrecision=DateToken.PRECISION_SECOND;
    }
    int millisecondValue=0;
    if (millisecond.connectedPortList().size() > 0 && millisecond.hasToken(0)) {
      millisecondValue=((IntToken)millisecond.get(0)).intValue();
      datePrecision=DateToken.PRECISION_MILLISECOND;
    }
    int microsecondValue=0;
    if (microsecond.connectedPortList().size() > 0 && microsecond.hasToken(0)) {
      microsecondValue=((IntToken)microsecond.get(0)).intValue();
      datePrecision=DateToken.PRECISION_MICROSECOND;
    }
    int nanosecondValue=0;
    if (nanosecond.connectedPortList().size() > 0 && nanosecond.hasToken(0)) {
      nanosecondValue=((IntToken)nanosecond.get(0)).intValue();
      datePrecision=DateToken.PRECISION_NANOSECOND;
    }
    String timeZoneValue=TimeZone.getDefault().getID();
    if ((timeZone.connectedPortList().size() > 0) && timeZone.hasToken(0)) {
      timeZoneValue=((StringToken)timeZone.get(0)).stringValue();
    }
    Calendar c=Calendar.getInstance();
    c.set(Calendar.YEAR,yearValue);
    c.set(Calendar.MONTH,monthValue);
    c.set(Calendar.DAY_OF_MONTH,dayValue);
    c.set(Calendar.HOUR,hourValue);
    c.set(Calendar.MINUTE,minuteValue);
    c.set(Calendar.SECOND,secondValue);
    c.set(Calendar.MILLISECOND,millisecondValue);
    c.setTimeZone(TimeZone.getTimeZone(timeZoneValue));
    dateToken=new DateToken(c.getTimeInMillis(),DateToken.PRECISION_MILLISECOND,TimeZone.getTimeZone(timeZoneValue));
    dateToken.addMicroseconds(microsecondValue);
    dateToken.addNanoseconds(nanosecondValue);
  }
  output.send(0,dateToken);
}

Fixed version (ground truth):
/** 
 * Construct a date token with all tokens present. If a token for the long value is present, use this token and time zone as well as precision. Otherwise use tokens on other inputs to create ports.
 * @exception IllegalActionException If there is no director.
 */
@Override public void fire() throws IllegalActionException {
  super.fire();
  DateToken dateToken=null;
  int datePrecision=DateToken.PRECISION_MILLISECOND;
  String precisionValue=((StringToken)precision.getToken()).stringValue();
  if (precisionValue.equals("String_Node_Str")) {
    datePrecision=DateToken.PRECISION_SECOND;
  }
  if (precisionValue.equals("String_Node_Str")) {
    datePrecision=DateToken.PRECISION_MILLISECOND;
  }
  if (precisionValue.equals("String_Node_Str")) {
    datePrecision=DateToken.PRECISION_MICROSECOND;
  }
  if (precisionValue.equals("String_Node_Str")) {
    datePrecision=DateToken.PRECISION_NANOSECOND;
  }
 else {
    datePrecision=DateToken.PRECISION_MILLISECOND;
  }
  String timeZoneValue=_getStringValue(timeZone);
  long timeAsLongValue=_getLongValue(timeInMillis);
  int microsecondValue=_getIntValue(microsecond);
  int nanosecondValue=_getIntValue(nanosecond);
  if (!((BooleanToken)useTimeInMillis.getToken()).booleanValue()) {
    int yearValue=_getIntValue(year);
    int monthValue=_getIntValue(month);
    int dayValue=_getIntValue(day);
    int hourValue=_getIntValue(hour);
    int minuteValue=_getIntValue(minute);
    int secondValue=_getIntValue(second);
    int millisecondValue=_getIntValue(millisecond);
    Calendar c=Calendar.getInstance();
    c.set(Calendar.YEAR,yearValue);
    c.set(Calendar.MONTH,monthValue);
    c.set(Calendar.DAY_OF_MONTH,dayValue);
    c.set(Calendar.HOUR,hourValue);
    c.set(Calendar.MINUTE,minuteValue);
    c.set(Calendar.SECOND,secondValue);
    c.set(Calendar.MILLISECOND,millisecondValue);
    timeAsLongValue=c.getTimeInMillis();
  }
  dateToken=new DateToken(timeAsLongValue,datePrecision,TimeZone.getTimeZone("String_Node_Str" + timeZoneValue));
  dateToken.addMicroseconds(microsecondValue);
  dateToken.addNanoseconds(nanosecondValue);
  output.send(0,dateToken);
}