Program: 65451
Project: 65451
Buggy source:
/** 
 * Receive notification of a node.
 * @param node The Node to be added to the document
 * @param namespaceResolver The NamespaceResolver can be used to resolve thenamespace URI/prefix of the node
 */
public void node(Node node,NamespaceResolver namespaceResolver){
  if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
    Attr attr=(Attr)node;
    String resolverPfx=null;
    if (getNamespaceResolver() != null) {
      resolverPfx=getNamespaceResolver().resolveNamespaceURI(attr.getNamespaceURI());
    }
    if (resolverPfx != null) {
      attribute(attr.getNamespaceURI(),XMLConstants.EMPTY_STRING,resolverPfx + XMLConstants.COLON + attr.getLocalName(),attr.getNodeValue());
    }
 else {
      attribute(attr.getNamespaceURI(),XMLConstants.EMPTY_STRING,attr.getName(),attr.getNodeValue());
      if (attr.getNamespaceURI() != null) {
        attribute(XMLConstants.XMLNS_URL,XMLConstants.EMPTY_STRING,XMLConstants.XMLNS + XMLConstants.COLON + attr.getPrefix(),attr.getNamespaceURI());
        this.getNamespaceResolver().put(attr.getPrefix(),attr.getNamespaceURI());
      }
    }
  }
 else   if (node.getNodeType() == Node.TEXT_NODE) {
    characters(node.getNodeValue());
  }
 else {
    try {
      FormattedWriterRecordContentHandler wrcHandler=new FormattedWriterRecordContentHandler();
      XMLFragmentReader xfragReader=new XMLFragmentReader(namespaceResolver);
      xfragReader.setContentHandler(wrcHandler);
      xfragReader.setProperty(XMLConstants.LEXICAL_HANDLER_PROPERTY,wrcHandler);
      xfragReader.parse(node);
    }
 catch (    SAXException sex) {
      throw XMLMarshalException.marshalException(sex);
    }
  }
}

Fixed version (ground truth):
/** 
 * Receive notification of a node.
 * @param node The Node to be added to the document
 * @param namespaceResolver The NamespaceResolver can be used to resolve thenamespace URI/prefix of the node
 */
public void node(Node node,NamespaceResolver namespaceResolver){
  if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
    Attr attr=(Attr)node;
    String resolverPfx=null;
    if (getNamespaceResolver() != null) {
      resolverPfx=getNamespaceResolver().resolveNamespaceURI(attr.getNamespaceURI());
    }
    if (resolverPfx != null) {
      attribute(attr.getNamespaceURI(),XMLConstants.EMPTY_STRING,resolverPfx + XMLConstants.COLON + attr.getLocalName(),attr.getNodeValue());
    }
 else {
      attribute(attr.getNamespaceURI(),XMLConstants.EMPTY_STRING,attr.getName(),attr.getNodeValue());
      if (attr.getNamespaceURI() != null) {
        namespaceDeclaration(attr.getPrefix(),attr.getNamespaceURI());
        this.getNamespaceResolver().put(attr.getPrefix(),attr.getNamespaceURI());
      }
    }
  }
 else   if (node.getNodeType() == Node.TEXT_NODE) {
    characters(node.getNodeValue());
  }
 else {
    try {
      FormattedWriterRecordContentHandler wrcHandler=new FormattedWriterRecordContentHandler();
      XMLFragmentReader xfragReader=new XMLFragmentReader(namespaceResolver);
      xfragReader.setContentHandler(wrcHandler);
      xfragReader.setProperty(XMLConstants.LEXICAL_HANDLER_PROPERTY,wrcHandler);
      xfragReader.parse(node);
    }
 catch (    SAXException sex) {
      throw XMLMarshalException.marshalException(sex);
    }
  }
}