Program: 73417
Project: 73417
Buggy source:
/** 
 * Set the parameters in the model stored in _parameterNames to the values given by _parameterValues. Those lists are populated by command line arguments.
 * @param model The model in which to update parameters.
 */
private void _updateParameters(NamedObj model){
  Iterator<String> names=_parameterNames.iterator();
  Iterator<String> values=_parameterValues.iterator();
  while (names.hasNext() && values.hasNext()) {
    String name=names.next();
    String value=values.next();
    Attribute attribute=model.getAttribute(name);
    if (attribute instanceof Settable) {
      String moml="String_Node_Str" + name + "String_Node_Str"+ value+ "String_Node_Str";
      MoMLChangeRequest request=new MoMLChangeRequest(this,model,moml);
      model.requestChange(request);
    }
 else {
      attribute=getAttribute(name);
      if (attribute instanceof Settable) {
        String moml="String_Node_Str" + name + "String_Node_Str"+ value+ "String_Node_Str";
        MoMLChangeRequest request=new MoMLChangeRequest(this,this,moml);
        model.requestChange(request);
      }
      attribute=getAttribute(name);
    }
    if (model instanceof CompositeActor) {
      ptolemy.actor.Director director=((CompositeActor)model).getDirector();
      if (director != null) {
        attribute=director.getAttribute(name);
        if (attribute instanceof Settable) {
          String moml="String_Node_Str" + name + "String_Node_Str"+ value+ "String_Node_Str";
          MoMLChangeRequest request=new MoMLChangeRequest(this,director,moml);
          director.requestChange(request);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Set the parameters in the model stored in _parameterNames to the values given by _parameterValues. Those lists are populated by command line arguments.
 * @param model The model in which to update parameters.
 */
private void _updateParameters(NamedObj model){
  Iterator<String> names=_parameterNames.iterator();
  Iterator<String> values=_parameterValues.iterator();
  while (names.hasNext() && values.hasNext()) {
    String name=names.next();
    String value=values.next();
    Attribute attribute=model.getAttribute(name);
    if (attribute instanceof Settable) {
      String moml="String_Node_Str" + name + "String_Node_Str"+ value+ "String_Node_Str";
      MoMLChangeRequest request=new MoMLChangeRequest(this,model,moml);
      model.requestChange(request);
    }
 else {
      attribute=getAttribute(name);
      if (attribute instanceof Settable) {
        String moml="String_Node_Str" + name + "String_Node_Str"+ value+ "String_Node_Str";
        MoMLChangeRequest request=new MoMLChangeRequest(this,this,moml);
        model.requestChange(request);
      }
    }
    if (model instanceof CompositeActor) {
      ptolemy.actor.Director director=((CompositeActor)model).getDirector();
      if (director != null) {
        attribute=director.getAttribute(name);
        if (attribute instanceof Settable) {
          String moml="String_Node_Str" + name + "String_Node_Str"+ value+ "String_Node_Str";
          MoMLChangeRequest request=new MoMLChangeRequest(this,director,moml);
          director.requestChange(request);
        }
      }
    }
  }
}