Program: 75931
Project: 75931
Buggy source:
/** 
 * Create a model.  In this base class, we check to see whether the applet has a parameter <i>modelClass</i>, and if so, then we instantiate the class specified in that parameter.  If not, then we create an empty instance of CompositeActor. It is required that the class specified in the modelClass parameter have a constructor that takes one argument, an instance of Workspace. In either case, if the resulting model does not have a manager, then we give it a manager.
 * @throws Exception If something goes wrong.
 */
protected CompositeActor _createModel() throws Exception {
  CompositeActor result=null;
  String modelSpecification=getParameter("String_Node_Str");
  if (modelSpecification != null) {
    Object[] arguments=new Object[1];
    arguments[0]=_workspace;
    Class modelClass=Class.forName(modelSpecification);
    Constructor[] constructors=modelClass.getConstructors();
    boolean foundConstructor=false;
    for (int i=0; i < constructors.length; i++) {
      Constructor constructor=constructors[i];
      Class[] parameterTypes=constructor.getParameterTypes();
      if (parameterTypes.length != arguments.length)       continue;
      boolean match=true;
      for (int j=0; j < parameterTypes.length; j++) {
        if (!(parameterTypes[j].isInstance(arguments[j]))) {
          match=false;
          break;
        }
      }
      if (match) {
        result=(CompositeActor)constructor.newInstance(arguments);
        foundConstructor=true;
      }
    }
    if (!foundConstructor) {
      throw new IllegalActionException("String_Node_Str" + modelSpecification);
    }
  }
  if (result == null) {
    throw new Exception("String_Node_Str");
  }
  if (result.getManager() == null) {
    _manager=new Manager(_workspace,"String_Node_Str");
    _manager.addExecutionListener(this);
    result.setManager(_manager);
  }
 else {
    _manager=result.getManager();
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Create a model.  In this base class, we check to see whether the applet has a parameter <i>modelClass</i>, and if so, then we instantiate the class specified in that parameter.  If not, then we create an empty instance of CompositeActor. It is required that the class specified in the modelClass parameter have a constructor that takes one argument, an instance of Workspace. In either case, if the resulting model does not have a manager, then we give it a manager.
 * @param workspace The workspace in which to create the model.
 * @return A model.
 * @throws Exception If something goes wrong.  This is a broadexception to allow derived classes wide lattitude as to which exception to throw.
 */
protected CompositeActor _createModel(Workspace workspace) throws Exception {
  CompositeActor result=null;
  String modelSpecification=getParameter("String_Node_Str");
  if (modelSpecification != null) {
    Object[] arguments=new Object[1];
    arguments[0]=workspace;
    Class modelClass=Class.forName(modelSpecification);
    Constructor[] constructors=modelClass.getConstructors();
    boolean foundConstructor=false;
    for (int i=0; i < constructors.length; i++) {
      Constructor constructor=constructors[i];
      Class[] parameterTypes=constructor.getParameterTypes();
      if (parameterTypes.length != arguments.length)       continue;
      boolean match=true;
      for (int j=0; j < parameterTypes.length; j++) {
        if (!(parameterTypes[j].isInstance(arguments[j]))) {
          match=false;
          break;
        }
      }
      if (match) {
        result=(CompositeActor)constructor.newInstance(arguments);
        foundConstructor=true;
      }
    }
    if (!foundConstructor) {
      throw new IllegalActionException("String_Node_Str" + modelSpecification);
    }
  }
  if (result == null) {
    throw new Exception("String_Node_Str");
  }
  return result;
}