Program: 90196
Project: 90196
Buggy source:
/** 
 * Updates this jobs order.xml to include filters defined by crawler traps for the given domain. The added nodes have the form <newObject name="domain.dk{0,1,2,..}" class="org.archive.crawler.filter.URIRegExpFilter"> <boolean name="enabled">true</boolean> <boolean name="if-match-return">true</boolean> <string name="regexp">theregexp</string> </newObject>
 * @param d The domain for which to generate crawler traps.
 * @throws ArgumentNotValid If unable to order.xml due to wrong order.xml format
 */
private void editOrderXML_crawlerTraps(Domain d) throws ArgumentNotValid {
  List<String> crawlerTraps=d.getCrawlerTraps();
  if (crawlerTraps.size() == 0) {
    return;
  }
  String filterMapXpath=HeritrixTemplate.ExcludeFilterMapXpath;
  Node filterMapNode=orderXMLdoc.selectSingleNode(filterMapXpath);
  if (filterMapNode == null || !(filterMapNode instanceof Element)) {
    throw new PermissionDenied("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  Element filterMap=(Element)filterMapNode;
  int count=0;
  for (  String trap : crawlerTraps) {
    Element filter=filterMap.addElement("String_Node_Str");
    filter.addAttribute("String_Node_Str",d.getName() + count);
    filter.addAttribute("String_Node_Str","String_Node_Str");
    Element enabled=filter.addElement("String_Node_Str");
    enabled.addAttribute("String_Node_Str","String_Node_Str");
    enabled.addText("String_Node_Str");
    Element ifMatchReturn=filter.addElement("String_Node_Str");
    ifMatchReturn.addAttribute("String_Node_Str","String_Node_Str");
    ifMatchReturn.addText("String_Node_Str");
    Element regexp=filter.addElement("String_Node_Str");
    regexp.addAttribute("String_Node_Str","String_Node_Str");
    regexp.addText(trap);
    count++;
  }
}

Fixed version (ground truth):
/** 
 * Updates this jobs order.xml to include filters defined by crawler traps for the given domain. The added nodes have the form <newObject name="domain.dk{0,1,2,..}" class="org.archive.crawler.filter.URIRegExpFilter"> <boolean name="enabled">true</boolean> <boolean name="if-match-return">true</boolean> <string name="regexp">theregexp</string> </newObject>
 * @param d The domain for which to generate crawler traps.
 * @throws ArgumentNotValid If unable to order.xml due to wrong order.xml format
 */
private void editOrderXML_crawlerTraps(Domain d) throws ArgumentNotValid {
  List<String> crawlerTraps=d.getCrawlerTraps();
  if (crawlerTraps.size() == 0) {
    return;
  }
  String filterMapXpath=HeritrixTemplate.EXCLUDE_FILTER_MAP_XPATH;
  Node filterMapNode=orderXMLdoc.selectSingleNode(filterMapXpath);
  if (filterMapNode == null || !(filterMapNode instanceof Element)) {
    throw new PermissionDenied("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  Element filterMap=(Element)filterMapNode;
  int count=0;
  for (  String trap : crawlerTraps) {
    Element filter=filterMap.addElement("String_Node_Str");
    filter.addAttribute("String_Node_Str",d.getName() + count);
    filter.addAttribute("String_Node_Str","String_Node_Str");
    Element enabled=filter.addElement("String_Node_Str");
    enabled.addAttribute("String_Node_Str","String_Node_Str");
    enabled.addText("String_Node_Str");
    Element ifMatchReturn=filter.addElement("String_Node_Str");
    ifMatchReturn.addAttribute("String_Node_Str","String_Node_Str");
    ifMatchReturn.addText("String_Node_Str");
    Element regexp=filter.addElement("String_Node_Str");
    regexp.addAttribute("String_Node_Str","String_Node_Str");
    regexp.addText(trap);
    count++;
  }
}