Program: 95445
Project: 95445
Buggy source:
/** 
 * @param fWriter where the test result will be wrote 
 * @throws IOException
 * @throws PMException
 * @throws OperationCanceledException 
 */
public void writeTestResultSummariesToFile(FileWriterWithEncoding fWriter) throws IOException, PMException, OperationCanceledException {
  ObjectMapper mapper=new ObjectMapper();
  mapper.setSerializationInclusion(Include.NON_EMPTY);
  fWriter.append(StringConstants.LEFT_BRACKET);
  float size=TestResultSummaryPM.countOfTestResultSummaries(m_project,null);
  long lastPage=(long)Math.ceil(size / ImportExportUtil.PAGE_SIZE);
  int pos=0;
  for (int countOfPage=1; countOfPage <= lastPage; countOfPage++) {
    ImportExportUtil.checkCancel(m_monitor);
    List<ITestResultSummaryPO> summaries=TestResultSummaryPM.getTestResultSummaries(m_project,null,countOfPage,ImportExportUtil.PAGE_SIZE);
    List<TestresultSummaryDTO> summaryDTOs=getTestResultSummaryDTOs(summaries);
    for (int countOfItemInPage=0; countOfItemInPage < summaryDTOs.size(); countOfItemInPage++) {
      pos++;
      TestresultSummaryDTO dto=summaryDTOs.get(countOfItemInPage);
      StringBuffer buffer=new StringBuffer();
      buffer.append(mapper.writeValueAsString(dto));
      if (!(countOfPage == lastPage && countOfItemInPage == summaryDTOs.size() - 1)) {
        buffer.append(StringConstants.COMMA);
      }
      fWriter.append(buffer);
      m_monitor.worked(1);
    }
    m_monitor.subTask(Messages.ImportJsonImportResult + pos + StringConstants.SLASH+ (int)size);
  }
  fWriter.append(StringConstants.RIGHT_BRACKET);
  fWriter.close();
}

Fixed version (ground truth):
/** 
 * @param fWriter where the test result will be wrote 
 * @throws IOException
 * @throws PMException
 * @throws OperationCanceledException 
 */
public void writeTestResultSummariesToFile(FileWriterWithEncoding fWriter) throws IOException, PMException, OperationCanceledException {
  ObjectMapper mapper=new ObjectMapper();
  mapper.setSerializationInclusion(Include.NON_NULL);
  fWriter.append(StringConstants.LEFT_BRACKET);
  float size=TestResultSummaryPM.countOfTestResultSummaries(m_project,null);
  long lastPage=(long)Math.ceil(size / ImportExportUtil.PAGE_SIZE);
  int pos=0;
  for (int countOfPage=1; countOfPage <= lastPage; countOfPage++) {
    ImportExportUtil.checkCancel(m_monitor);
    List<ITestResultSummaryPO> summaries=TestResultSummaryPM.getTestResultSummaries(m_project,null,countOfPage,ImportExportUtil.PAGE_SIZE);
    List<TestresultSummaryDTO> summaryDTOs=getTestResultSummaryDTOs(summaries);
    for (int countOfItemInPage=0; countOfItemInPage < summaryDTOs.size(); countOfItemInPage++) {
      pos++;
      TestresultSummaryDTO dto=summaryDTOs.get(countOfItemInPage);
      StringBuffer buffer=new StringBuffer();
      buffer.append(mapper.writeValueAsString(dto));
      if (!(countOfPage == lastPage && countOfItemInPage == summaryDTOs.size() - 1)) {
        buffer.append(StringConstants.COMMA);
      }
      fWriter.append(buffer);
      m_monitor.worked(1);
    }
    m_monitor.subTask(Messages.ImportJsonImportResult + pos + StringConstants.SLASH+ (int)size);
  }
  fWriter.append(StringConstants.RIGHT_BRACKET);
  fWriter.close();
}