Program: 72555
Project: 72555
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 thrown by the superclass,if there is no director, ifthere is a problem reading a parameter, or if there is a problem sending the date token.
 */
@Override public void fire(){
  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;
  }
 else   if (precisionValue.equals("String_Node_Str")) {
    datePrecision=DateToken.PRECISION_MILLISECOND;
  }
 else   if (precisionValue.equals("String_Node_Str")) {
    datePrecision=DateToken.PRECISION_MICROSECOND;
  }
 else   if (precisionValue.equals("String_Node_Str")) {
    datePrecision=DateToken.PRECISION_NANOSECOND;
  }
 else {
    datePrecision=DateToken.PRECISION_MILLISECOND;
  }
  Integer timeZoneValue=_getIntValue(timeZoneOffset);
  TimeZone timeZone=TimeZone.getDefault();
  if (timeZoneValue != null) {
    timeZone=TimeZone.getTimeZone("String_Node_Str" + (timeZoneValue < 0 ? "String_Node_Str" : "String_Node_Str") + String.format("String_Node_Str",timeZoneValue));
  }
  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(timeZone);
    c.set(Calendar.YEAR,yearValue);
    c.set(Calendar.MONTH,monthValue);
    c.set(Calendar.DAY_OF_MONTH,dayValue);
    c.set(Calendar.HOUR_OF_DAY,hourValue);
    c.set(Calendar.MINUTE,minuteValue);
    c.set(Calendar.SECOND,secondValue);
    c.set(Calendar.MILLISECOND,millisecondValue);
    timeAsLongValue=c.getTimeInMillis();
    if (datePrecision == DateToken.PRECISION_SECOND) {
      timeAsLongValue=timeAsLongValue / 1000;
    }
 else     if (datePrecision == DateToken.PRECISION_MICROSECOND) {
      timeAsLongValue=timeAsLongValue * 1000;
    }
 else     if (datePrecision == DateToken.PRECISION_NANOSECOND) {
      timeAsLongValue=timeAsLongValue * 1000 * 1000;
    }
  }
  dateToken=new DateToken(timeAsLongValue,datePrecision,timeZone);
  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 thrown by the superclass,if there is no director, ifthere is a problem reading a parameter, or if there is a problem sending the date token.
 */
@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;
  }
 else   if (precisionValue.equals("String_Node_Str")) {
    datePrecision=DateToken.PRECISION_MILLISECOND;
  }
 else   if (precisionValue.equals("String_Node_Str")) {
    datePrecision=DateToken.PRECISION_MICROSECOND;
  }
 else   if (precisionValue.equals("String_Node_Str")) {
    datePrecision=DateToken.PRECISION_NANOSECOND;
  }
 else {
    datePrecision=DateToken.PRECISION_MILLISECOND;
  }
  Integer timeZoneValue=_getIntValue(timeZoneOffset);
  TimeZone timeZone=TimeZone.getDefault();
  if (timeZoneValue != null) {
    timeZone=TimeZone.getTimeZone("String_Node_Str" + (timeZoneValue < 0 ? "String_Node_Str" : "String_Node_Str") + String.format("String_Node_Str",timeZoneValue));
  }
  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(timeZone);
    c.set(Calendar.YEAR,yearValue);
    c.set(Calendar.MONTH,monthValue);
    c.set(Calendar.DAY_OF_MONTH,dayValue);
    c.set(Calendar.HOUR_OF_DAY,hourValue);
    c.set(Calendar.MINUTE,minuteValue);
    c.set(Calendar.SECOND,secondValue);
    c.set(Calendar.MILLISECOND,millisecondValue);
    timeAsLongValue=c.getTimeInMillis();
    if (datePrecision == DateToken.PRECISION_SECOND) {
      timeAsLongValue=timeAsLongValue / 1000;
    }
 else     if (datePrecision == DateToken.PRECISION_MICROSECOND) {
      timeAsLongValue=timeAsLongValue * 1000;
    }
 else     if (datePrecision == DateToken.PRECISION_NANOSECOND) {
      timeAsLongValue=timeAsLongValue * 1000 * 1000;
    }
  }
  dateToken=new DateToken(timeAsLongValue,datePrecision,timeZone);
  dateToken.addMicroseconds(microsecondValue);
  dateToken.addNanoseconds(nanosecondValue);
  output.send(0,dateToken);
}