Program: 72755
Project: 72755
Buggy source:
void doRun() throws EngineException {
  doValidateParameters();
  setupRenderOption();
  loadDesign();
  prepareDesign();
  startFactory();
  startRender();
  try {
    IContentEmitter emitter=createContentEmitter();
    IReportExecutor executor=new ReportExecutor(executionContext);
    executor=new SuppressDuplciateReportExecutor(executor);
    executor=new LocalizedReportExecutor(executionContext,executor);
    executionContext.setExecutor(executor);
    initializeContentEmitter(emitter,executor);
    String format=executionContext.getOutputFormat();
    boolean paginate=true;
    if (FORMAT_HTML.equalsIgnoreCase(format)) {
      HTMLRenderOption htmlOption=new HTMLRenderOption(renderOptions);
      paginate=htmlOption.getHtmlPagination();
    }
    if (ExtensionManager.NO_PAGINATION.equals(pagination)) {
      paginate=false;
    }
synchronized (this) {
      if (!executionContext.isCanceled()) {
        layoutEngine=createReportLayoutEngine(pagination,renderOptions);
      }
    }
    if (layoutEngine != null) {
      layoutEngine.setLocale(executionContext.getLocale());
      CompositeLayoutPageHandler layoutPageHandler=new CompositeLayoutPageHandler();
      OnPageBreakLayoutPageHandle handle=new OnPageBreakLayoutPageHandle(executionContext);
      layoutPageHandler.addPageHandler(handle);
      layoutPageHandler.addPageHandler(new ContextPageBreakHandler(executionContext));
      layoutEngine.setPageHandler(layoutPageHandler);
      CompositeContentEmitter outputEmitters=new CompositeContentEmitter(format);
      outputEmitters.addEmitter(emitter);
      outputEmitters.addEmitter(handle.getEmitter());
      IReportContent report=executor.execute();
      outputEmitters.start(report);
      layoutEngine.layout(executor,report,outputEmitters,paginate);
      layoutEngine.close();
      outputEmitters.end(report);
    }
    closeRender();
    executionContext.closeDataEngine();
    closeFactory();
  }
 catch (  EngineException 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;
  }
catch (  Throwable t) {
    log.log(Level.SEVERE,"String_Node_Str",t);
    throw new EngineException("String_Node_Str",t);
  }
}

Fixed version (ground truth):
void doRun() throws EngineException {
  doValidateParameters();
  setupRenderOption();
  loadDesign();
  prepareDesign();
  startFactory();
  startRender();
  try {
    IContentEmitter emitter=createContentEmitter();
    IReportExecutor executor=new ReportExecutor(executionContext);
    executor=new SuppressDuplciateReportExecutor(executor);
    executor=new LocalizedReportExecutor(executionContext,executor);
    executionContext.setExecutor(executor);
    initializeContentEmitter(emitter,executor);
    String format=executionContext.getOutputFormat();
    boolean paginate=true;
    if (FORMAT_HTML.equalsIgnoreCase(format)) {
      HTMLRenderOption htmlOption=new HTMLRenderOption(renderOptions);
      paginate=htmlOption.getHtmlPagination();
    }
    if (ExtensionManager.NO_PAGINATION.equals(pagination)) {
      paginate=false;
    }
synchronized (this) {
      if (!executionContext.isCanceled()) {
        layoutEngine=createReportLayoutEngine(pagination,renderOptions);
      }
    }
    if (layoutEngine != null) {
      layoutEngine.setLocale(executionContext.getLocale());
      CompositeLayoutPageHandler layoutPageHandler=new CompositeLayoutPageHandler();
      OnPageBreakLayoutPageHandle handle=new OnPageBreakLayoutPageHandle(executionContext);
      layoutPageHandler.addPageHandler(handle);
      layoutPageHandler.addPageHandler(new ContextPageBreakHandler(executionContext));
      layoutEngine.setPageHandler(layoutPageHandler);
      CompositeContentEmitter outputEmitters=new CompositeContentEmitter(format);
      outputEmitters.addEmitter(emitter);
      outputEmitters.addEmitter(handle.getEmitter());
      IReportContent report=executor.execute();
      outputEmitters.start(report);
      layoutEngine.layout(executor,report,outputEmitters,paginate);
      layoutEngine.close();
      outputEmitters.end(report);
    }
    closeRender();
    executionContext.closeDataEngine();
    closeFactory();
  }
 catch (  EngineException e) {
    throw e;
  }
catch (  Exception ex) {
    log.log(Level.SEVERE,"String_Node_Str",ex);
    throw new EngineException(MessageConstants.REPORT_RUN_ERROR,ex);
  }
catch (  OutOfMemoryError err) {
    log.log(Level.SEVERE,"String_Node_Str");
    throw err;
  }
catch (  Throwable t) {
    log.log(Level.SEVERE,"String_Node_Str",t);
    throw new EngineException(MessageConstants.REPORT_RUN_ERROR,t);
  }
}