Program: 74610
Project: 74610
Buggy source:
/** 
 * Add an invisible Parameter to the PtalonActor with the specified name and the given expression as its value.
 * @param name The name of the parameter.
 * @exception PtalonRuntimeException If the symbol does notexist, or if the symbol already has a parameter associated with it, or if an IllegalActionException is thrown trying to create the parameter.
 */
public void addParameter(String name,String expression) throws PtalonRuntimeException {
  try {
    String uniqueName=null;
    PtalonExpressionParameter parameter=null;
    Attribute attribute=_actor.getAttribute(name);
    if (attribute != null) {
      if (attribute instanceof PtalonExpressionParameter) {
        parameter=(PtalonExpressionParameter)attribute;
        if (parameter.hasValue()) {
          uniqueName=name;
        }
      }
    }
    if (uniqueName == null) {
      uniqueName=_actor.uniqueName(name);
      parameter=new PtalonExpressionParameter(_actor,uniqueName);
    }
    parameter.setVisibility(Settable.NONE);
    _currentIfTree.setStatus(name,true);
    if (_inNewWhileIteration()) {
      if (_currentIfTree.isForStatement) {
        _currentIfTree.setEnteredIteration(name,_currentIfTree.entered);
      }
 else {
        IfTree tree=_currentIfTree;
        while (!tree.isForStatement) {
          tree=tree.getParent();
          if (tree == null) {
            throw new PtalonRuntimeException("String_Node_Str" + "String_Node_Str");
          }
        }
        _currentIfTree.setEnteredIteration(name,tree.entered);
      }
    }
 else {
      _currentIfTree.setEnteredIteration(name,_currentIfTree.entered);
    }
    _currentIfTree.mapName(name,uniqueName);
    _unassignedParameters.add(parameter);
    _unassignedParameterValues.add(expression);
  }
 catch (  NameDuplicationException ex) {
    throw new PtalonRuntimeException("String_Node_Str",ex);
  }
catch (  IllegalActionException ex) {
    throw new PtalonRuntimeException("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Add an invisible Parameter to the PtalonActor with the specified name and the given expression as its value.
 * @param name The name of the parameter.
 * @param expression The expression representing the parameter.
 * @exception PtalonRuntimeException If the symbol does notexist, or if the symbol already has a parameter associated with it, or if an IllegalActionException is thrown trying to create the parameter.
 */
public void addParameter(String name,String expression) throws PtalonRuntimeException {
  try {
    String uniqueName=null;
    PtalonExpressionParameter parameter=null;
    Attribute attribute=_actor.getAttribute(name);
    if (attribute != null) {
      if (attribute instanceof PtalonExpressionParameter) {
        parameter=(PtalonExpressionParameter)attribute;
        if (parameter.hasValue()) {
          uniqueName=name;
        }
      }
    }
    if (uniqueName == null) {
      uniqueName=_actor.uniqueName(name);
      parameter=new PtalonExpressionParameter(_actor,uniqueName);
    }
    parameter.setVisibility(Settable.NONE);
    _currentIfTree.setStatus(name,true);
    if (_inNewWhileIteration()) {
      if (_currentIfTree.isForStatement) {
        _currentIfTree.setEnteredIteration(name,_currentIfTree.entered);
      }
 else {
        IfTree tree=_currentIfTree;
        while (!tree.isForStatement) {
          tree=tree.getParent();
          if (tree == null) {
            throw new PtalonRuntimeException("String_Node_Str" + "String_Node_Str");
          }
        }
        _currentIfTree.setEnteredIteration(name,tree.entered);
      }
    }
 else {
      _currentIfTree.setEnteredIteration(name,_currentIfTree.entered);
    }
    _currentIfTree.mapName(name,uniqueName);
    _unassignedParameters.add(parameter);
    _unassignedParameterValues.add(expression);
  }
 catch (  NameDuplicationException ex) {
    throw new PtalonRuntimeException("String_Node_Str",ex);
  }
catch (  IllegalActionException ex) {
    throw new PtalonRuntimeException("String_Node_Str",ex);
  }
}