Program: 74628
Project: 74628
Buggy source:
/** 
 * Write a MoML description of the contents of this object, which in this class is the configuration information. This method is called by exportMoML().  Each description is indented according to the specified depth and terminated with a newline character.
 * @param output The output stream to write to.
 * @param depth The depth in the hierarchy, to determine indenting.
 * @exception IOException If an I/O error occurs.
 */
protected void _exportMoMLContents(Writer output,int depth) throws IOException {
  try {
    for (    Object att : attributeList()) {
      if (!(att instanceof Parameter)) {
        Attribute attribute=(Attribute)att;
        attribute.exportMoML(output,depth);
      }
    }
    if (astCreated) {
      String filename;
      try {
        filename=ptalonCodeLocation.asFile().toURI().toString();
      }
 catch (      IllegalActionException ex) {
        throw new IOException("String_Node_Str");
      }
      if (filename.startsWith("String_Node_Str")) {
        filename=filename.substring(5);
      }
      if (filename.startsWith("String_Node_Str")) {
        filename=filename.substring(1);
      }
      String ptiiDir=StringUtilities.getProperty("String_Node_Str");
      File ptiiDirFile=new File(ptiiDir);
      String prefix=ptiiDirFile.toURI().toString();
      if (prefix.startsWith("String_Node_Str")) {
        prefix=prefix.substring(5);
      }
      if (prefix.startsWith("String_Node_Str")) {
        prefix=prefix.substring(1);
      }
      String ptiiFilename=filename.substring(prefix.length());
      String unPtlnName=ptiiFilename.substring(0,ptiiFilename.length() - 5);
      String displayName=unPtlnName.replace('/','.');
      output.write(_getIndentPrefix(depth) + "String_Node_Str");
      output.write(_getIndentPrefix(depth + 1) + "String_Node_Str" + displayName+ "String_Node_Str");
      for (      PtalonParameter param : _assignedPtalonParameters) {
        if (!_unsettablePtalonParameters.contains(param)) {
          if (param instanceof PtalonExpressionParameter) {
            String expression=param.getExpression();
            expression=expression.replaceAll("String_Node_Str","String_Node_Str");
            output.write(_getIndentPrefix(depth + 2) + "String_Node_Str" + param.getName()+ "String_Node_Str"+ expression+ "String_Node_Str");
          }
 else           if (param instanceof PtalonParameter) {
            output.write(_getIndentPrefix(depth + 2) + "String_Node_Str" + param.getName()+ "String_Node_Str"+ param.getExpression()+ "String_Node_Str");
          }
        }
      }
      output.write(_getIndentPrefix(depth + 1) + "String_Node_Str");
      output.write(_getIndentPrefix(depth) + "String_Node_Str");
    }
  }
 catch (  IOException ex) {
    throw ex;
  }
}

Fixed version (ground truth):
/** 
 * Write a MoML description of the contents of this object, which in this class is the configuration information. This method is called by exportMoML().  Each description is indented according to the specified depth and terminated with a newline character.
 * @param output The output stream to write to.
 * @param depth The depth in the hierarchy, to determine indenting.
 * @exception IOException If an I/O error occurs.
 */
protected void _exportMoMLContents(Writer output,int depth) throws IOException {
  try {
    for (    Object att : attributeList()) {
      if (!(att instanceof Parameter)) {
        Attribute attribute=(Attribute)att;
        attribute.exportMoML(output,depth);
      }
    }
    if (astCreated) {
      String filename;
      try {
        filename=ptalonCodeLocation.asFile().toURI().toString();
      }
 catch (      IllegalActionException ex) {
        throw new IOException("String_Node_Str");
      }
      if (filename.startsWith("String_Node_Str")) {
        filename=filename.substring(5);
      }
      if (filename.startsWith("String_Node_Str")) {
        filename=filename.substring(1);
      }
      String ptiiDir=StringUtilities.getProperty("String_Node_Str");
      File ptiiDirFile=new File(ptiiDir);
      String prefix=ptiiDirFile.toURI().toString();
      if (prefix.startsWith("String_Node_Str")) {
        prefix=prefix.substring(5);
      }
      if (prefix.startsWith("String_Node_Str")) {
        prefix=prefix.substring(1);
      }
      String ptiiFilename=filename.substring(prefix.length());
      String unPtlnName=ptiiFilename.substring(0,ptiiFilename.length() - 5);
      String displayName=unPtlnName.replace('/','.');
      output.write(_getIndentPrefix(depth) + "String_Node_Str");
      output.write(_getIndentPrefix(depth + 1) + "String_Node_Str" + displayName+ "String_Node_Str");
      for (      PtalonParameter param : _assignedPtalonParameters) {
        if (!_unsettablePtalonParameters.contains(param)) {
          if (param instanceof PtalonExpressionParameter) {
            String expression=param.getExpression();
            expression=expression.replaceAll("String_Node_Str","String_Node_Str");
            output.write(_getIndentPrefix(depth + 2) + "String_Node_Str" + param.getName()+ "String_Node_Str"+ expression+ "String_Node_Str");
          }
 else {
            output.write(_getIndentPrefix(depth + 2) + "String_Node_Str" + param.getName()+ "String_Node_Str"+ param.getExpression()+ "String_Node_Str");
          }
        }
      }
      output.write(_getIndentPrefix(depth + 1) + "String_Node_Str");
      output.write(_getIndentPrefix(depth) + "String_Node_Str");
    }
  }
 catch (  IOException ex) {
    throw ex;
  }
}