Program: 74390
Project: 74390
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.  Note that this only saves the values of the Ptalon parameters; it does not save other entities generated as a result of parsing the Ptalon file.
 * @param output The output stream for writing.
 * @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.asURL().toString();
      }
 catch (      IllegalActionException ex) {
        IOException ex2=new IOException("String_Node_Str" + "String_Node_Str" + ptalonCodeLocation + "String_Node_Str");
        ex2.initCause(ex);
        throw ex2;
      }
      if (filename.startsWith("String_Node_Str")) {
        filename=filename.substring(5);
      }
      if (filename.startsWith("String_Node_Str")) {
        filename=filename.substring(9);
      }
      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;
  }
}

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.  Note that this only saves the values of the Ptalon parameters; it does not save other entities generated as a result of parsing the Ptalon file.
 * @param output The output stream for writing.
 * @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.asURL().toString();
      }
 catch (      IllegalActionException ex) {
        IOException ex2=new IOException("String_Node_Str" + "String_Node_Str" + ptalonCodeLocation + "String_Node_Str");
        ex2.initCause(ex);
        throw ex2;
      }
      if (!filename.toLowerCase().endsWith("String_Node_Str")) {
        throw new IOException("String_Node_Str" + "String_Node_Str");
      }
      filename=filename.substring(0,filename.length() - 5);
      if (filename.startsWith("String_Node_Str")) {
        filename=filename.substring(5);
      }
      if (filename.startsWith("String_Node_Str")) {
        filename=filename.substring(9);
      }
      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);
      }
      String displayName;
      if (filename.toLowerCase().startsWith(prefix.toLowerCase())) {
        int i=0;
        while (filename.startsWith("String_Node_Str")) {
          filename=filename.substring(1);
          i++;
        }
        displayName=filename.substring(prefix.length() - i);
      }
 else {
        displayName=filename;
      }
      displayName=displayName.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;
  }
}