Program: 89284
Project: 89284
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 generateJSONTransferReport(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");
    writer.write(ISO8601DateFormat.format((Date)this.nodeService.getProperty(transferNode,ContentModel.PROP_CREATED)));
    writer.write("String_Node_Str");
    writer.write(AuthenticationUtil.getRunAsUser());
    writer.write("String_Node_Str");
    writer.write(dispositionAuthority != null ? dispositionAuthority : "String_Node_Str");
    writer.write("String_Node_Str");
    generateTransferItemsJSON(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 generateJSONTransferReport(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");
    writer.write(ISO8601DateFormat.format((Date)this.nodeService.getProperty(transferNode,ContentModel.PROP_CREATED)));
    writer.write("String_Node_Str");
    writer.write(AuthenticationUtil.getRunAsUser());
    writer.write("String_Node_Str");
    writer.write(dispositionAuthority != null ? dispositionAuthority : "String_Node_Str");
    writer.write("String_Node_Str");
    generateTransferItemsJSON(writer,itemsToTransfer);
    writer.write("String_Node_Str");
  }
  finally {
    if (writer != null) {
      try {
        writer.close();
      }
 catch (      IOException ioe) {
      }
    }
  }
  return report;
}