Program: 72934
Project: 72934
Buggy source:
/** 
 * Ensure that the order parameter is positive and recompute the size of internal buffers.
 * @param attribute The attribute that has changed.
 * @exception IllegalActionException If the parameters are out of range.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == emissionDistribution) {
    String functionName=emissionDistribution.getExpression().trim().toLowerCase();
    if (functionName.equals("String_Node_Str")) {
      _distribution=_GAUSSIAN;
    }
 else     if (functionName.equals("String_Node_Str")) {
      _distribution=_EXPONENTIAL;
    }
 else     if (functionName.equals("String_Node_Str")) {
      _distribution=_RICIAN;
    }
 else     if (functionName.equals("String_Node_Str")) {
      _distribution=_MULTINOMIAL;
    }
 else {
      throw new IllegalActionException(this,"String_Node_Str" + functionName + "String_Node_Str"+ "String_Node_Str");
    }
  }
 else   if (attribute == modelType) {
    String modelName=modelType.getExpression().trim().toLowerCase();
    if (modelName.equals("String_Node_Str")) {
      _modelType=_MM;
      transitionMatrix.setTypeEquals(new ArrayType(BaseType.DOUBLE));
    }
 else     if (modelName.equals("String_Node_Str")) {
      _modelType=_HMM;
      transitionMatrix.setTypeEquals(BaseType.DOUBLE_MATRIX);
    }
 else {
      throw new IllegalActionException(this,"String_Node_Str" + modelName + "String_Node_Str");
    }
  }
 else {
    super.attributeChanged(attribute);
  }
}

Fixed version (ground truth):
/** 
 * Ensure that the order parameter is positive and recompute the size of internal buffers.
 * @param attribute The attribute that has changed.
 * @exception IllegalActionException If the parameters are out of range.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == emissionDistribution) {
    String functionName=emissionDistribution.getExpression().trim().toLowerCase();
    if (functionName.equals("String_Node_Str")) {
      _distribution=_GAUSSIAN;
    }
 else     if (functionName.equals("String_Node_Str")) {
      _distribution=_EXPONENTIAL;
    }
 else     if (functionName.equals("String_Node_Str")) {
      _distribution=_RICIAN;
    }
 else     if (functionName.equals("String_Node_Str")) {
      _distribution=_MULTINOMIAL;
    }
 else {
      throw new IllegalActionException(this,"String_Node_Str" + functionName + "String_Node_Str"+ "String_Node_Str");
    }
  }
 else   if (attribute == modelType) {
    String modelName=modelType.getExpression().trim().toLowerCase();
    if (modelName.equals("String_Node_Str")) {
      _modelType=_MM;
    }
 else     if (modelName.equals("String_Node_Str")) {
      _modelType=_HMM;
    }
 else {
      throw new IllegalActionException(this,"String_Node_Str" + modelName + "String_Node_Str");
    }
  }
 else   if (attribute == mean) {
    _nStates=((ArrayToken)mean.getToken()).length();
    _meanEstimate=new double[_nStates];
    for (int i=0; i < _nStates; i++) {
      _meanEstimate[i]=((DoubleToken)((ArrayToken)mean.getToken()).getElement(i)).doubleValue();
    }
  }
 else   if (attribute == standardDeviation) {
    _nStates=((ArrayToken)standardDeviation.getToken()).length();
    _stDeviationEstimate=new double[_nStates];
    for (int i=0; i < _nStates; i++) {
      _stDeviationEstimate[i]=((DoubleToken)((ArrayToken)standardDeviation.getToken()).getElement(i)).doubleValue();
    }
  }
 else   if (attribute == prior) {
    _nStates=((ArrayToken)standardDeviation.getToken()).length();
    _priors=new double[_nStates];
    for (int i=0; i < _nStates; i++) {
      _priors[i]=((DoubleToken)((ArrayToken)prior.getToken()).getElement(i)).doubleValue();
    }
  }
 else   if (attribute == transitionMatrix) {
    _nStates=((ArrayToken)standardDeviation.getToken()).length();
    _transitionMatrixEstimate=new double[_nStates][_nStates];
    for (int i=0; i < _nStates; i++) {
      for (int j=0; j < _nStates; j++) {
        _transitionMatrixEstimate[i][j]=((DoubleToken)((MatrixToken)transitionMatrix.getToken()).getElementAsToken(i,j)).doubleValue();
      }
    }
  }
 else {
    super.attributeChanged(attribute);
  }
}