Program: 73464
Project: 73464
Buggy source:
/** 
 * Return a new time object whose time value is the sum of that of this time object and of the specified time object. The two time objects are expected to have directors with the same time resolution. If they do not, then the returned result is a new Time object representing the sum of the double values of the two Time objects. This would not be as accurate. If either Time object has a non-null remainder term, then the resulting Time would find the sum of the remainder terms. If the sum of two fractions results in, for example 3/3, then the remainder term is set to null, and the integer term is incremented by 1.
 * @param time The time object contains the amount of time increment.
 * @return A new time object with the quantized and incremented time value.
 * @exception ArithmeticException If the result is not a valid number(it is the sum of positive and negative infinity).
 */
public Time add(Time time){
  if (time._isNegativeInfinite) {
    if (_isPositiveInfinite) {
      throw new ArithmeticException("String_Node_Str" + "String_Node_Str");
    }
 else {
      return NEGATIVE_INFINITY;
    }
  }
 else   if (time._isPositiveInfinite) {
    if (_isNegativeInfinite) {
      throw new ArithmeticException("String_Node_Str" + "String_Node_Str");
    }
 else {
      return POSITIVE_INFINITY;
    }
  }
 else   if (isInfinite()) {
    return this;
  }
  try {
    double resolution=_timeResolution();
    if (resolution != time._timeResolution()) {
      double thisValue=getDoubleValue();
      double thatValue=time.getDoubleValue();
      return new Time(_director,thisValue + thatValue);
    }
  }
 catch (  IllegalActionException e) {
    throw new InternalErrorException(e);
  }
  if (!hasRemainder() && !time.hasRemainder()) {
    return new Time(_director,_timeValue.add(time._timeValue),null,null);
  }
 else   if (hasRemainder() && !time.hasRemainder()) {
    return new Time(_director,_timeValue.add(time._timeValue),_divisorAndRemainder[0],_divisorAndRemainder[1]);
  }
 else   if (!hasRemainder() && time.hasRemainder()) {
    return new Time(_director,_timeValue.add(time._timeValue),time._divisorAndRemainder[0],time._divisorAndRemainder[1]);
  }
 else {
    BigInteger gcd=_divisorAndRemainder[0].gcd(time._divisorAndRemainder[0]);
    BigInteger lcm=_divisorAndRemainder[0].multiply(time._divisorAndRemainder[0]).divide(gcd);
    BigInteger factor1=lcm.divide(_divisorAndRemainder[0]);
    BigInteger factor2=lcm.divide(time._divisorAndRemainder[0]);
    _divisorAndRemainder[1]=_divisorAndRemainder[1].multiply(factor1);
    time._divisorAndRemainder[1]=time._divisorAndRemainder[1].multiply(factor2);
    return new Time(_director,_timeValue.add(time._timeValue),lcm,_divisorAndRemainder[1].add(time._divisorAndRemainder[1]));
  }
}

Fixed version (ground truth):
/** 
 * Return a new time object whose time value is the sum of that of this time object and of the specified time object. The two time objects are expected to have directors with the same time resolution. If they do not, then the returned result is a new Time object representing the sum of the double values of the two Time objects. This would not be as accurate. If either Time object has a non-null remainder term, then the resulting Time would find the sum of the remainder terms. If the sum of two fractions results in, for example 3/3, then the remainder term is set to null, and the integer term is incremented by 1.
 * @param time The time object contains the amount of time increment.
 * @return A new time object with the quantized and incremented time value.
 * @exception ArithmeticException If the result is not a valid number(it is the sum of positive and negative infinity).
 */
public Time add(Time time){
  if (time._isNegativeInfinite) {
    if (_isPositiveInfinite) {
      throw new ArithmeticException("String_Node_Str" + "String_Node_Str");
    }
 else {
      return NEGATIVE_INFINITY;
    }
  }
 else   if (time._isPositiveInfinite) {
    if (_isNegativeInfinite) {
      throw new ArithmeticException("String_Node_Str" + "String_Node_Str");
    }
 else {
      return POSITIVE_INFINITY;
    }
  }
 else   if (isInfinite()) {
    return this;
  }
  try {
    double resolution=_timeResolution();
    if (resolution != time._timeResolution()) {
      double thisValue=getDoubleValue();
      double thatValue=time.getDoubleValue();
      return new Time(_director,thisValue + thatValue);
    }
  }
 catch (  IllegalActionException e) {
    throw new InternalErrorException(e);
  }
  if (!hasRemainder() && !time.hasRemainder()) {
    return new Time(_director,_timeValue.add(time._timeValue),null,null);
  }
 else   if (hasRemainder() && !time.hasRemainder()) {
    return new Time(_director,_timeValue.add(time._timeValue),_divisorAndRemainder[0],_divisorAndRemainder[1]);
  }
 else   if (!hasRemainder() && time.hasRemainder()) {
    return new Time(_director,_timeValue.add(time._timeValue),time._divisorAndRemainder[0],time._divisorAndRemainder[1]);
  }
 else {
    BigInteger gcd=_divisorAndRemainder[0].gcd(time._divisorAndRemainder[0]);
    BigInteger lcm=_divisorAndRemainder[0].multiply(time._divisorAndRemainder[0]).divide(gcd);
    BigInteger factor1=lcm.divide(_divisorAndRemainder[0]);
    BigInteger factor2=lcm.divide(time._divisorAndRemainder[0]);
    BigInteger temp1=_divisorAndRemainder[1].multiply(factor1);
    BigInteger temp2=time._divisorAndRemainder[1].multiply(factor2);
    return new Time(_director,_timeValue.add(time._timeValue),lcm,temp1.add(temp2));
  }
}