Program: 122603
Project: 122603
Buggy source:
private List<URL> parseXml2HtmlPdf(String tempFolderPath,String jobName,String xslFilePath) throws Exception {
  HTMLHandler.clearExternalNodeFileCache();
  String htmlFilePath=tempFolderPath + File.separatorChar + jobName+ IHTMLDocConstants.HTML_FILE_SUFFIX;
  String xmlFilePath=tempFolderPath + File.separatorChar + jobName+ IHTMLDocConstants.XML_FILE_SUFFIX;
  HTMLHandler.generateHTMLFile(tempFolderPath,xslFilePath,xmlFilePath,htmlFilePath,this.externalNodeHTMLMap);
  File originalXmlFile=new File(xmlFilePath);
  if (originalXmlFile.exists()) {
    String pdfXmlPath=tempFolderPath + File.separatorChar + "String_Node_Str"+ jobName+ IHTMLDocConstants.XML_FILE_SUFFIX;
    File pdfXmlFile=new File(pdfXmlPath);
    if (pdfXmlFile.exists()) {
      pdfXmlFile.delete();
    }
    FilesUtils.copyFile(originalXmlFile,pdfXmlFile);
    SAXReader saxReader=new SAXReader();
    Document document=saxReader.read(pdfXmlFile);
    Attribute attri=(Attribute)document.selectNodes("String_Node_Str").get(0);
    attri.setValue(IHTMLDocConstants.PICTUREFOLDERPATH + "String_Node_Str" + jobName+ IHTMLDocConstants.JOB_PREVIEW_PIC_SUFFIX);
    List attributeList=document.selectNodes("String_Node_Str");
    for (int i=0; i < attributeList.size(); i++) {
      Attribute at=(Attribute)attributeList.get(i);
      String externalValue=at.getValue().substring(at.getValue().indexOf("String_Node_Str") + 1);
      String value=IHTMLDocConstants.PICTUREFOLDERPATH + "String_Node_Str" + externalValue;
      at.setValue(value);
    }
    XMLHandler.generateXMLFile(tempFolderPath,pdfXmlPath,document);
    HTMLHandler.clearExternalNodeFileCache();
    String htmlPdfPath=tempFolderPath + File.separatorChar + "String_Node_Str"+ jobName+ IHTMLDocConstants.HTML_FILE_SUFFIX;
    HTMLHandler.generateHTMLFile(tempFolderPath,xslFilePath,pdfXmlPath,htmlPdfPath,this.externalNodeHTMLMap);
  }
  return getParsedUrl(tempFolderPath);
}

Fixed version (ground truth):
private List<URL> parseXml2HtmlPdf(String tempFolderPath,String jobName,String xslFilePath) throws Exception {
  HTMLHandler.clearExternalNodeFileCache();
  String htmlFilePath=tempFolderPath + File.separatorChar + jobName+ IHTMLDocConstants.HTML_FILE_SUFFIX;
  String xmlFilePath=tempFolderPath + File.separatorChar + jobName+ IHTMLDocConstants.XML_FILE_SUFFIX;
  HTMLHandler.generateHTMLFile(tempFolderPath,xslFilePath,xmlFilePath,htmlFilePath,this.externalNodeHTMLMap);
  File originalXmlFile=new File(xmlFilePath);
  if (originalXmlFile.exists()) {
    String pdfXmlPath=tempFolderPath + File.separatorChar + "String_Node_Str"+ jobName+ IHTMLDocConstants.XML_FILE_SUFFIX;
    File pdfXmlFile=new File(pdfXmlPath);
    if (pdfXmlFile.exists()) {
      pdfXmlFile.delete();
    }
    FilesUtils.copyFile(originalXmlFile,pdfXmlFile);
    SAXReader saxReader=new SAXReader();
    Reader reader=new InputStreamReader(new FileInputStream(pdfXmlFile),"String_Node_Str");
    Document document=saxReader.read(reader);
    Attribute attri=(Attribute)document.selectNodes("String_Node_Str").get(0);
    attri.setValue(IHTMLDocConstants.PICTUREFOLDERPATH + "String_Node_Str" + jobName+ IHTMLDocConstants.JOB_PREVIEW_PIC_SUFFIX);
    List attributeList=document.selectNodes("String_Node_Str");
    for (int i=0; i < attributeList.size(); i++) {
      Attribute at=(Attribute)attributeList.get(i);
      String externalValue=at.getValue().substring(at.getValue().indexOf("String_Node_Str") + 1);
      String value=IHTMLDocConstants.PICTUREFOLDERPATH + "String_Node_Str" + externalValue;
      at.setValue(value);
    }
    XMLHandler.generateXMLFile(tempFolderPath,pdfXmlPath,document);
    HTMLHandler.clearExternalNodeFileCache();
    String htmlPdfPath=tempFolderPath + File.separatorChar + "String_Node_Str"+ jobName+ IHTMLDocConstants.HTML_FILE_SUFFIX;
    HTMLHandler.generateHTMLFile(tempFolderPath,xslFilePath,pdfXmlPath,htmlPdfPath,this.externalNodeHTMLMap);
  }
  return getParsedUrl(tempFolderPath);
}