Program: 77560
Project: 77560
Buggy source:
/** 
 * @param pageNumber the page to be rendered
 * @throws EngineException throws exception if there is a rendering error
 */
protected void doRender(List pageSequences) throws EngineException {
  if (pageSequences.size() == 0) {
    return;
  }
  try {
    ReportDesignHandle reportDesign=executionContext.getDesign();
    IContentEmitter emitter=createContentEmitter();
    String format=executionContext.getOutputFormat();
    if ("String_Node_Str".equalsIgnoreCase(format)) {
      IReportExecutor executor=new ReportPageReader(executionContext,pageSequences,false);
      executor=new LocalizedReportExecutor(executionContext,executor);
      executionContext.setExecutor(executor);
      initializeContentEmitter(emitter,executor);
      IReportLayoutEngine layoutEngine=LayoutEngineFactory.createLayoutEngine(format);
      OnPageBreakLayoutPageHandle handle=new OnPageBreakLayoutPageHandle(executionContext);
      layoutEngine.setPageHandler(handle);
      startRender();
      layoutEngine.layout(executor,emitter,true);
      closeRender();
      executor.close();
    }
 else {
      IReportExecutor executor=new ReportExecutor(executionContext,reportDesign,null);
      executor=new LocalizedReportExecutor(executionContext,executor);
      executionContext.setExecutor(executor);
      initializeContentEmitter(emitter,executor);
      ReportContentLoader loader=new ReportContentLoader(executionContext);
      startRender();
      IRenderOption renderOption=executionContext.getRenderOption();
      if (renderOption instanceof HTMLRenderOption) {
        boolean htmlPagination=((HTMLRenderOption)renderOption).getHtmlPagination();
        bodyOnly=!htmlPagination;
      }
      loader.loadPageRange(pageSequences,bodyOnly,emitter);
      closeRender();
      executor.close();
    }
  }
 catch (  Exception ex) {
    log.log(Level.SEVERE,"String_Node_Str",ex);
  }
catch (  OutOfMemoryError err) {
    log.log(Level.SEVERE,"String_Node_Str");
    throw err;
  }
}

Fixed version (ground truth):
/** 
 * @param pageNumber the page to be rendered
 * @throws EngineException throws exception if there is a rendering error
 */
protected void doRender(List pageSequences) throws EngineException {
  if (pageSequences.size() == 0) {
    return;
  }
  try {
    ReportDesignHandle reportDesign=executionContext.getDesign();
    IContentEmitter emitter=createContentEmitter();
    String format=executionContext.getOutputFormat();
    if ("String_Node_Str".equalsIgnoreCase(format)) {
      IReportExecutor executor=new ReportPageReader(executionContext,pageSequences,false);
      executor=new LocalizedReportExecutor(executionContext,executor);
      executionContext.setExecutor(executor);
      initializeContentEmitter(emitter,executor);
      IReportLayoutEngine layoutEngine=LayoutEngineFactory.createLayoutEngine(format);
      OnPageBreakLayoutPageHandle handle=new OnPageBreakLayoutPageHandle(executionContext);
      layoutEngine.setPageHandler(handle);
      startRender();
      layoutEngine.layout(executor,emitter,true);
      closeRender();
      executor.close();
    }
 else {
      IReportExecutor executor=new ReportExecutor(executionContext,reportDesign,null);
      executor=new LocalizedReportExecutor(executionContext,executor);
      executionContext.setExecutor(executor);
      initializeContentEmitter(emitter,executor);
      ReportContentLoader loader=new ReportContentLoader(executionContext);
      startRender();
      IRenderOption renderOption=executionContext.getRenderOption();
      if (renderOption instanceof HTMLRenderOption) {
        boolean htmlPagination=((HTMLRenderOption)renderOption).getHtmlPagination();
        bodyOnly=!htmlPagination;
      }
      loader.loadPageRange(pageSequences,bodyOnly,emitter);
      closeRender();
      executor.close();
    }
  }
 catch (  EngineException e) {
    log.log(Level.SEVERE,"String_Node_Str",e);
    throw e;
  }
catch (  Exception ex) {
    log.log(Level.SEVERE,"String_Node_Str",ex);
    throw new EngineException("String_Node_Str",ex);
  }
catch (  OutOfMemoryError err) {
    log.log(Level.SEVERE,"String_Node_Str");
    throw err;
  }
}