Program: 75804
Project: 75804
Buggy source:
/** 
 * Return the java code associated with a top level Ptolemy II object and all of its descendants.
 * @param toplevel The root object of the topology to be saved.
 * @return The generated java code.
 */
public String generate(NamedObj toplevel) throws IllegalActionException {
  String className=toplevel.getClass().getName();
  String code=new String();
  String importCode=new String();
  CompositeEntity compositeModel;
  _importList=new LinkedList();
  if (!(toplevel instanceof CompositeEntity)) {
    throw new IllegalActionException(toplevel,"String_Node_Str");
  }
  compositeModel=(CompositeEntity)toplevel;
  String sanitizedName=_name(compositeModel);
  code+="String_Node_Str" + sanitizedName + "String_Node_Str"+ _getClassName(compositeModel)+ "String_Node_Str"+ _indent(1)+ "String_Node_Str"+ sanitizedName+ "String_Node_Str"+ "String_Node_Str"+ _indent(2)+ "String_Node_Str"+ _indent(2)+ "String_Node_Str";
  code+=_indent(2) + "String_Node_Str" + _getClassName(compositeModel)+ "String_Node_Str";
  code+=_generateAttributes(compositeModel);
  code+=_generateComponents(compositeModel);
  code+=_indent(2) + "String_Node_Str" + _indent(3)+ "String_Node_Str"+ _indent(2)+ "String_Node_Str"+ _indent(1)+ "String_Node_Str"+ "String_Node_Str";
  _insertIfUnique("String_Node_Str",_importList);
  _insertIfUnique("String_Node_Str",_importList);
  _insertIfUnique("String_Node_Str",_importList);
  try {
    Iterator iter=_importList.iterator();
    while (iter.hasNext()) {
      String p=(String)(iter.next());
      importCode+="String_Node_Str" + p + "String_Node_Str";
    }
    code=importCode + "String_Node_Str" + code;
  }
 catch (  Exception ex) {
    throw new IllegalActionException(ex.getMessage() + "String_Node_Str" + importCode+ "String_Node_Str");
  }
  return code;
}

Fixed version (ground truth):
/** 
 * Return the java code associated with a top level Ptolemy II object and all of its descendants.
 * @param toplevel The root object of the topology to be saved.
 * @return The generated java code.
 */
public String generate(NamedObj toplevel) throws IllegalActionException {
  String className=toplevel.getClass().getName();
  String code=new String();
  String importCode=new String();
  CompositeEntity compositeModel;
  _importList=new LinkedList();
  if (!(toplevel instanceof CompositeEntity)) {
    throw new IllegalActionException(toplevel,"String_Node_Str");
  }
  compositeModel=(CompositeEntity)toplevel;
  String sanitizedName=_name(compositeModel);
  code+="String_Node_Str" + sanitizedName + "String_Node_Str"+ _getClassName(compositeModel)+ "String_Node_Str"+ _indent(1)+ "String_Node_Str"+ sanitizedName+ "String_Node_Str"+ "String_Node_Str"+ _indent(2)+ "String_Node_Str"+ _indent(2)+ "String_Node_Str";
  code+=_indent(2) + "String_Node_Str" + _getClassName(compositeModel)+ "String_Node_Str";
  code+=_generateAttributes(compositeModel);
  code+=_generateComponents(compositeModel);
  code+=_indent(2) + "String_Node_Str" + _indent(3)+ "String_Node_Str"+ _indent(2)+ "String_Node_Str"+ _indent(1)+ "String_Node_Str"+ "String_Node_Str";
  _insertIfUnique("String_Node_Str",_importList);
  _insertIfUnique("String_Node_Str",_importList);
  _insertIfUnique("String_Node_Str",_importList);
  try {
    Iterator iter=_importList.iterator();
    while (iter.hasNext()) {
      String p=(String)(iter.next());
      importCode+="String_Node_Str" + p + "String_Node_Str";
    }
    code=importCode + "String_Node_Str" + code;
  }
 catch (  Exception ex) {
    throw new IllegalActionException(ex.getMessage() + "String_Node_Str" + "String_Node_Str"+ importCode+ "String_Node_Str");
  }
  return code;
}