Program: 74331
Project: 74331
Buggy source:
protected void _saveAttributes(NamedObj model,File attributesPath,boolean force) throws IllegalActionException {
  for (  Object attrObject : model.attributeList(Variable.class)) {
    Variable attr=(Variable)attrObject;
    for (    Object paramObject : attr.attributeList(NaomiParameter.class)) {
      NaomiParameter naomiParam=(NaomiParameter)paramObject;
      String attributeName=naomiParam.getAttributeName();
      if (!_outputAttributes.contains(attributeName)) {
        continue;
      }
      File attributeFile=new File(attributesPath,attributeName);
      Date attributeDate=naomiParam.getModifiedDate();
      if (!force) {
        Date fileDate=new Date(attributeFile.lastModified());
        if (attributeFile.exists() && attributeFile.isFile() && !fileDate.before(attributeDate)) {
          continue;
        }
      }
      String newValue=attr.getToken().toString();
      System.out.println("String_Node_Str" + attributeName + "String_Node_Str"+ newValue);
      String unit=naomiParam.getUnit();
      String doc=naomiParam.getDocumentation();
      try {
        DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
        docFactory.setNamespaceAware(true);
        DocumentBuilder builder;
        builder=docFactory.newDocumentBuilder();
        DOMImplementation impl=builder.getDOMImplementation();
        Document document=impl.createDocument(NAMESPACES[0][1],"String_Node_Str",null);
        Element root=document.getDocumentElement();
        Attr attribute=document.createAttributeNS("String_Node_Str","String_Node_Str");
        attribute.setPrefix("String_Node_Str");
        attribute.setValue("String_Node_Str" + "String_Node_Str");
        root.setAttributeNodeNS(attribute);
        Element owner=document.createElementNS(NAMESPACES[0][1],"String_Node_Str");
        owner.setTextContent(_owner);
        root.appendChild(owner);
        Element value=document.createElementNS(NAMESPACES[0][1],"String_Node_Str");
        value.setTextContent(StringUtilities.escapeForXML(newValue));
        root.appendChild(value);
        Element units=document.createElementNS(NAMESPACES[0][1],"String_Node_Str");
        if (!unit.equals("String_Node_Str")) {
          units.setTextContent(StringUtilities.escapeForXML(unit));
        }
        root.appendChild(units);
        Element documentation=document.createElementNS(NAMESPACES[0][1],"String_Node_Str");
        if (!doc.equals("String_Node_Str")) {
          documentation.setTextContent(StringUtilities.escapeForXML(doc));
        }
        root.appendChild(documentation);
        FileOutputStream stream=new FileOutputStream(attributeFile);
        _serializeXML(document,stream);
        if (!attributeFile.setLastModified(attributeDate.getTime())) {
          throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + attributeFile.getName() + "String_Node_Str");
        }
      }
 catch (      ParserConfigurationException e) {
        throw new IllegalActionException(null,e,"String_Node_Str");
      }
catch (      FileNotFoundException e) {
        throw new IllegalActionException(null,e,"String_Node_Str" + attributeFile.getPath());
      }
    }
  }
}

Fixed version (ground truth):
protected void _saveAttributes(NamedObj model,File attributesPath,boolean force) throws IllegalActionException {
  for (  Object attrObject : model.attributeList(Variable.class)) {
    Variable attr=(Variable)attrObject;
    for (    Object paramObject : attr.attributeList(NaomiParameter.class)) {
      NaomiParameter naomiParam=(NaomiParameter)paramObject;
      String attributeName=naomiParam.getAttributeName();
      if (!_outputAttributes.contains(attributeName)) {
        continue;
      }
      File attributeFile=new File(attributesPath,attributeName);
      Date attributeDate=naomiParam.getModifiedDate();
      if (!force) {
        Date fileDate=new Date(attributeFile.lastModified());
        if (attributeFile.exists() && attributeFile.isFile() && !fileDate.before(attributeDate)) {
          continue;
        }
      }
      attr.invalidate();
      String newValue=attr.getToken().toString();
      System.out.println("String_Node_Str" + attributeName + "String_Node_Str"+ newValue);
      String unit=naomiParam.getUnit();
      String doc=naomiParam.getDocumentation();
      try {
        DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
        docFactory.setNamespaceAware(true);
        DocumentBuilder builder;
        builder=docFactory.newDocumentBuilder();
        DOMImplementation impl=builder.getDOMImplementation();
        Document document=impl.createDocument(NAMESPACES[0][1],"String_Node_Str",null);
        Element root=document.getDocumentElement();
        Attr attribute=document.createAttributeNS("String_Node_Str","String_Node_Str");
        attribute.setPrefix("String_Node_Str");
        attribute.setValue("String_Node_Str" + "String_Node_Str");
        root.setAttributeNodeNS(attribute);
        Element owner=document.createElementNS(NAMESPACES[0][1],"String_Node_Str");
        owner.setTextContent(_owner);
        root.appendChild(owner);
        Element value=document.createElementNS(NAMESPACES[0][1],"String_Node_Str");
        value.setTextContent(StringUtilities.escapeForXML(newValue));
        root.appendChild(value);
        Element units=document.createElementNS(NAMESPACES[0][1],"String_Node_Str");
        if (!unit.equals("String_Node_Str")) {
          units.setTextContent(StringUtilities.escapeForXML(unit));
        }
        root.appendChild(units);
        Element documentation=document.createElementNS(NAMESPACES[0][1],"String_Node_Str");
        if (!doc.equals("String_Node_Str")) {
          documentation.setTextContent(StringUtilities.escapeForXML(doc));
        }
        root.appendChild(documentation);
        FileOutputStream stream=new FileOutputStream(attributeFile);
        _serializeXML(document,stream);
        if (!attributeFile.setLastModified(attributeDate.getTime())) {
          throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + attributeFile.getName() + "String_Node_Str");
        }
      }
 catch (      ParserConfigurationException e) {
        throw new IllegalActionException(null,e,"String_Node_Str");
      }
catch (      FileNotFoundException e) {
        throw new IllegalActionException(null,e,"String_Node_Str" + attributeFile.getPath());
      }
    }
  }
}