Program: 72503
Project: 72503
Buggy source:
/** 
 * Write a MoML description of this object, unless this object is not persistent. MoML is an XML modeling markup language. In this class, the object is identified by the "property" element, with "name" and "class" (XML) attributes. The body of the element, between the "&lt;property&gt;" and "&lt;/property&gt;", is written using the _exportMoMLContents() protected method, so that derived classes can override that method alone to alter only how the contents of this object are described. The text that is written is indented according to the specified depth, with each line (including the last one) terminated with a newline.
 * @param output The output stream to write to.
 * @param depth The depth in the hierarchy, to determine indenting.
 * @param name The name to use instead of the current name.
 * @exception IOException If an I/O error occurs.
 * @see #isPersistent()
 */
@Override public void exportMoML(Writer output,int depth,String name) throws IOException {
  if (_isMoMLSuppressed(depth)) {
    return;
  }
  String value=_currentExpression;
  if (value == null) {
    ptolemy.data.Token token=null;
    try {
      token=getToken();
    }
 catch (    IllegalActionException ex) {
    }
    if (token != null) {
      if (isStringMode()) {
        value=((StringToken)token).stringValue();
      }
 else {
        value=token.toString();
      }
    }
  }
  String valueTerm="String_Node_Str";
  if (value != null) {
    valueTerm="String_Node_Str" + StringUtilities.escapeForXML(value) + "String_Node_Str";
  }
  name=StringUtilities.escapeForXML(name);
  output.write(_getIndentPrefix(depth) + "String_Node_Str" + _elementName+ "String_Node_Str"+ name+ "String_Node_Str"+ getClassName()+ "String_Node_Str"+ valueTerm+ "String_Node_Str");
  _exportMoMLContents(output,depth + 1);
  output.write(_getIndentPrefix(depth) + "String_Node_Str" + _elementName+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Write a MoML description of this object, unless this object is not persistent. MoML is an XML modeling markup language. In this class, the object is identified by the "property" element, with "name" and "class" (XML) attributes. The body of the element, between the "&lt;property&gt;" and "&lt;/property&gt;", is written using the _exportMoMLContents() protected method, so that derived classes can override that method alone to alter only how the contents of this object are described. The text that is written is indented according to the specified depth, with each line (including the last one) terminated with a newline.
 * @param output The output stream to write to.
 * @param depth The depth in the hierarchy, to determine indenting.
 * @param name The name to use instead of the current name.
 * @exception IOException If an I/O error occurs.
 * @see #isPersistent()
 */
@Override public void exportMoML(Writer output,int depth,String name) throws IOException {
  if (_isMoMLSuppressed(depth)) {
    return;
  }
  String value=_getCurrentExpression();
  if (value == null) {
    ptolemy.data.Token token=null;
    try {
      token=getToken();
    }
 catch (    IllegalActionException ex) {
    }
    if (token != null) {
      if (isStringMode()) {
        value=((StringToken)token).stringValue();
      }
 else {
        value=token.toString();
      }
    }
  }
  String valueTerm="String_Node_Str";
  if (value != null) {
    valueTerm="String_Node_Str" + StringUtilities.escapeForXML(value) + "String_Node_Str";
  }
  name=StringUtilities.escapeForXML(name);
  output.write(_getIndentPrefix(depth) + "String_Node_Str" + _elementName+ "String_Node_Str"+ name+ "String_Node_Str"+ getClassName()+ "String_Node_Str"+ valueTerm+ "String_Node_Str");
  _exportMoMLContents(output,depth + 1);
  output.write(_getIndentPrefix(depth) + "String_Node_Str" + _elementName+ "String_Node_Str");
}