Program: 89285
Project: 89285
Buggy source:
/** 
 * Generates a File containing the JSON representation of a transfer report.
 * @param transferNode The transfer node
 * @return File containing JSON representation of a transfer report
 * @throws IOException
 */
File generateHTMLTransferReport(NodeRef transferNode) throws IOException {
  File report=TempFileProvider.createTempFile(REPORT_FILE_PREFIX,REPORT_FILE_SUFFIX);
  Writer writer=null;
  try {
    NodeRef[] itemsToTransfer=getTransferNodes(transferNode);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + itemsToTransfer.length + "String_Node_Str"+ report.getAbsolutePath());
    }
    writer=new FileWriter(report);
    String dispositionAuthority=null;
    if (itemsToTransfer.length > 0) {
      DispositionSchedule ds=dispositionService.getDispositionSchedule(itemsToTransfer[0]);
      if (ds != null) {
        dispositionAuthority=ds.getDispositionAuthority();
      }
    }
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    Boolean isAccession=(Boolean)this.nodeService.getProperty(transferNode,PROP_TRANSFER_ACCESSION_INDICATOR);
    if (isAccession) {
      writer.write("String_Node_Str");
    }
 else {
      writer.write("String_Node_Str");
    }
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    if (isAccession) {
      writer.write("String_Node_Str");
    }
 else {
      writer.write("String_Node_Str");
    }
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    Date transferDate=(Date)this.nodeService.getProperty(transferNode,ContentModel.PROP_CREATED);
    writer.write(StringEscapeUtils.escapeHtml(transferDate.toString()));
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    if (isAccession) {
      writer.write("String_Node_Str");
    }
 else {
      writer.write(StringEscapeUtils.escapeHtml((String)this.nodeService.getProperty(transferNode,RecordsManagementModel.PROP_TRANSFER_LOCATION)));
    }
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write(StringEscapeUtils.escapeHtml((String)this.nodeService.getProperty(transferNode,ContentModel.PROP_CREATOR)));
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write(dispositionAuthority != null ? StringEscapeUtils.escapeHtml(dispositionAuthority) : "String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    generateTransferItemsHTML(writer,itemsToTransfer);
    writer.write("String_Node_Str");
  }
  finally {
    if (writer != null) {
      try {
        writer.close();
      }
 catch (      IOException ioe) {
      }
    }
  }
  return report;
}

Fixed version (ground truth):
/** 
 * Generates a File containing the JSON representation of a transfer report.
 * @param transferNode The transfer node
 * @return File containing JSON representation of a transfer report
 * @throws IOException
 */
File generateHTMLTransferReport(NodeRef transferNode) throws IOException {
  File report=TempFileProvider.createTempFile(REPORT_FILE_PREFIX,REPORT_FILE_SUFFIX);
  Writer writer=null;
  try {
    NodeRef[] itemsToTransfer=getTransferNodes(transferNode);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + itemsToTransfer.length + "String_Node_Str"+ report.getAbsolutePath());
    }
    writer=new OutputStreamWriter(new FileOutputStream(report),Charset.forName("String_Node_Str"));
    String dispositionAuthority=null;
    if (itemsToTransfer.length > 0) {
      DispositionSchedule ds=dispositionService.getDispositionSchedule(itemsToTransfer[0]);
      if (ds != null) {
        dispositionAuthority=ds.getDispositionAuthority();
      }
    }
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    Boolean isAccession=(Boolean)this.nodeService.getProperty(transferNode,PROP_TRANSFER_ACCESSION_INDICATOR);
    if (isAccession) {
      writer.write("String_Node_Str");
    }
 else {
      writer.write("String_Node_Str");
    }
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    if (isAccession) {
      writer.write("String_Node_Str");
    }
 else {
      writer.write("String_Node_Str");
    }
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    Date transferDate=(Date)this.nodeService.getProperty(transferNode,ContentModel.PROP_CREATED);
    writer.write(StringEscapeUtils.escapeHtml(transferDate.toString()));
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    if (isAccession) {
      writer.write("String_Node_Str");
    }
 else {
      writer.write(StringEscapeUtils.escapeHtml((String)this.nodeService.getProperty(transferNode,RecordsManagementModel.PROP_TRANSFER_LOCATION)));
    }
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write(StringEscapeUtils.escapeHtml((String)this.nodeService.getProperty(transferNode,ContentModel.PROP_CREATOR)));
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    writer.write(dispositionAuthority != null ? StringEscapeUtils.escapeHtml(dispositionAuthority) : "String_Node_Str");
    writer.write("String_Node_Str");
    writer.write("String_Node_Str");
    generateTransferItemsHTML(writer,itemsToTransfer);
    writer.write("String_Node_Str");
  }
  finally {
    if (writer != null) {
      try {
        writer.close();
      }
 catch (      IOException ioe) {
      }
    }
  }
  return report;
}