Program: 24091
Project: 24091
Buggy source:
private void writeElement(Writer out,Element node,XhtmlGeneratorAdornerState state,int level) throws Exception {
  out.write("String_Node_Str" + node.getNodeName() + "String_Node_Str");
  if (node.hasAttributes()) {
    out.write("String_Node_Str");
    XhtmlGeneratorAdornerState newstate=adorner == null ? new XhtmlGeneratorAdornerState("String_Node_Str","String_Node_Str") : adorner.getState(this,state,node);
    for (int i=0; i < node.getAttributes().getLength(); i++) {
      if (adorner != null) {
        XhtmlGeneratorAdornerState attrState=adorner.getAttributeMarkup(this,newstate,node,node.getAttributes().item(i).getNodeName(),node.getAttributes().item(i).getTextContent());
        out.write("String_Node_Str" + node.getAttributes().item(i).getNodeName() + "String_Node_Str"+ attrState.getPrefix()+ escapeHtml(Utilities.escapeXml(node.getAttributes().item(i).getTextContent()),level)+ attrState.getSuffix()+ "String_Node_Str");
      }
 else       out.write("String_Node_Str" + node.getAttributes().item(i).getNodeName() + "String_Node_Str"+ escapeHtml(Utilities.escapeXml(node.getAttributes().item(i).getTextContent()),level)+ "String_Node_Str");
    }
    out.write("String_Node_Str");
  }
  if (node.hasChildNodes()) {
    out.write("String_Node_Str");
    XhtmlGeneratorAdornerState newstate=adorner == null ? new XhtmlGeneratorAdornerState("String_Node_Str","String_Node_Str") : adorner.getState(this,state,node);
    if (newstate.isSuppress())     out.write("String_Node_Str" + escapeHtml(newstate.getSupressionMessage(),level) + "String_Node_Str");
 else {
      out.write(newstate.getPrefix());
      for (int i=0; i < node.getChildNodes().getLength(); i++)       writeNode(out,node.getChildNodes().item(i),newstate,level + 2);
      out.write(newstate.getSuffix());
    }
    out.write("String_Node_Str" + node.getNodeName() + "String_Node_Str");
  }
 else   out.write("String_Node_Str");
}

Fixed version (ground truth):
private void writeElement(Writer out,Element node,XhtmlGeneratorAdornerState state,int level) throws Exception {
  String link=adorner == null ? null : adorner.getLink(this,state,node);
  if (link != null)   out.write("String_Node_Str" + link + "String_Node_Str"+ node.getNodeName()+ "String_Node_Str");
 else   out.write("String_Node_Str" + node.getNodeName() + "String_Node_Str");
  if (node.hasAttributes()) {
    out.write("String_Node_Str");
    XhtmlGeneratorAdornerState newstate=adorner == null ? new XhtmlGeneratorAdornerState("String_Node_Str","String_Node_Str") : adorner.getState(this,state,node);
    for (int i=0; i < node.getAttributes().getLength(); i++) {
      if (adorner != null) {
        XhtmlGeneratorAdornerState attrState=adorner.getAttributeMarkup(this,newstate,node,node.getAttributes().item(i).getNodeName(),node.getAttributes().item(i).getTextContent());
        out.write("String_Node_Str" + node.getAttributes().item(i).getNodeName() + "String_Node_Str"+ attrState.getPrefix()+ escapeHtml(Utilities.escapeXml(node.getAttributes().item(i).getTextContent()),level)+ attrState.getSuffix()+ "String_Node_Str");
      }
 else       out.write("String_Node_Str" + node.getAttributes().item(i).getNodeName() + "String_Node_Str"+ escapeHtml(Utilities.escapeXml(node.getAttributes().item(i).getTextContent()),level)+ "String_Node_Str");
    }
    out.write("String_Node_Str");
  }
  if (node.hasChildNodes()) {
    out.write("String_Node_Str");
    XhtmlGeneratorAdornerState newstate=adorner == null ? new XhtmlGeneratorAdornerState("String_Node_Str","String_Node_Str") : adorner.getState(this,state,node);
    if (newstate.isSuppress())     out.write("String_Node_Str" + escapeHtml(newstate.getSupressionMessage(),level) + "String_Node_Str");
 else {
      out.write(newstate.getPrefix());
      for (int i=0; i < node.getChildNodes().getLength(); i++)       writeNode(out,node.getChildNodes().item(i),newstate,level + 2);
      out.write(newstate.getSuffix());
    }
    if (link != null)     out.write("String_Node_Str" + link + "String_Node_Str"+ node.getNodeName()+ "String_Node_Str");
 else     out.write("String_Node_Str" + node.getNodeName() + "String_Node_Str");
  }
 else   out.write("String_Node_Str");
}