Program: 66087
Project: 66087
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 (namespaceResolver != null) {
      resolverPfx=namespaceResolver.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());
      }
    }
  }
 else {
    if (isStartElementOpen) {
      openAndCloseStartElement();
      isStartElementOpen=false;
    }
    if (node.getNodeType() == Node.TEXT_NODE) {
      characters(node.getNodeValue());
    }
 else {
      XMLFragmentReader xfragReader=new XMLFragmentReader(namespaceResolver);
      xfragReader.setContentHandler(contentHandler);
      try {
        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=this.getNamespaceResolver().resolveNamespaceURI(attr.getNamespaceURI());
    }
    String namespaceURI=attr.getNamespaceURI();
    String localName=attr.getLocalName();
    if (localName == null) {
      localName=XMLConstants.EMPTY_STRING;
    }
    if (resolverPfx != null) {
      attribute(namespaceURI,localName,resolverPfx + XMLConstants.COLON + attr.getLocalName(),attr.getNodeValue());
    }
 else {
      attribute(namespaceURI,localName,attr.getName(),attr.getNodeValue());
      if (namespaceURI != null) {
        attribute(XMLConstants.XMLNS_URL,localName,XMLConstants.XMLNS + XMLConstants.COLON + attr.getPrefix(),attr.getNamespaceURI());
        this.getNamespaceResolver().put(attr.getPrefix(),attr.getNamespaceURI());
      }
    }
  }
 else {
    if (isStartElementOpen) {
      openAndCloseStartElement();
      isStartElementOpen=false;
    }
    if (node.getNodeType() == Node.TEXT_NODE) {
      characters(node.getNodeValue());
    }
 else {
      XMLFragmentReader xfragReader=new XMLFragmentReader(namespaceResolver);
      xfragReader.setContentHandler(contentHandler);
      try {
        xfragReader.parse(node);
      }
 catch (      SAXException sex) {
        throw XMLMarshalException.marshalException(sex);
      }
    }
  }
}