Program: 67369
Project: 67369
Buggy source:
/** 
 * runs the report
 * @throws EngineException throws exception when there is a run error
 */
protected void doRun() throws EngineException {
  if (progressMonitor != null) {
    progressMonitor.onProgress(IProgressMonitor.START_TASK,TASK_RUN);
  }
  loadDataSource();
  doValidateParameters();
  ReportDesignHandle design=executionContext.getReportDesign();
  if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(design.getLayoutPreference())) {
    executionContext.setFixedLayout(true);
    setupRenderOption();
    updateRtLFlag();
  }
  initReportVariable();
  loadDesign();
  prepareDesign();
  startFactory();
  openReportDocument();
  try {
    ReportRunnable newRunnable=writer.saveDesign(executionContext.getRunnable(),executionContext.getOriginalRunnable());
    executionContext.updateRunnable(newRunnable);
    writer.saveReportIR(executionContext.getReport());
    writer.saveParamters(inputValues);
    executionContext.openDataEngine();
synchronized (this) {
      if (!executionContext.isCanceled()) {
        documentBuilder=new ReportDocumentBuilder(executionContext,writer);
      }
    }
    if (documentBuilder != null) {
      if (pageHandler != null) {
        documentBuilder.setPageHandler(pageHandler);
      }
      IContentEmitter emitter=documentBuilder.getContentEmitter();
      IReportExecutor executor=new ReportExecutor(executionContext);
      executor=createReportExtensionExecutor(executor);
      executor=new ReportEmitterExecutor(executor,emitter);
      executor=new SuppressDuplciateReportExecutor(executor);
      if (executionContext.isFixedLayout()) {
        executor=new LocalizedReportExecutor(executionContext,executor);
      }
      executionContext.setExecutor(executor);
      initializeContentEmitter(emitter,executor);
      documentBuilder.build();
    }
    executionContext.closeDataEngine();
  }
 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);
  }
 finally {
    documentBuilder=null;
    closeFactory();
    writer.savePersistentObjects(executionContext.getGlobalBeans());
    closeReportDocument();
    if (pageHandler != null && !executionContext.isCanceled()) {
      int totalPage=(int)executionContext.getTotalPage();
      IReportDocumentInfo docInfo=new ReportDocumentInfo(executionContext,totalPage,true);
      pageHandler.onPage(totalPage,true,docInfo);
    }
    if (progressMonitor != null) {
      progressMonitor.onProgress(IProgressMonitor.END_TASK,TASK_RUN);
    }
  }
}

Fixed version (ground truth):
/** 
 * runs the report
 * @throws EngineException throws exception when there is a run error
 */
protected void doRun() throws EngineException {
  if (progressMonitor != null) {
    progressMonitor.onProgress(IProgressMonitor.START_TASK,TASK_RUN);
  }
  loadDataSource();
  doValidateParameters();
  ReportDesignHandle design=executionContext.getReportDesign();
  if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(design.getLayoutPreference())) {
    executionContext.setFixedLayout(true);
    setupRenderOption();
    updateRtLFlag();
  }
  initReportVariable();
  loadDesign();
  prepareDesign();
  startFactory();
  openReportDocument();
  try {
    ReportRunnable newRunnable=writer.saveDesign(executionContext.getRunnable(),executionContext.getOriginalRunnable());
    executionContext.updateRunnable(newRunnable);
    writer.saveReportIR(executionContext.getReport());
    writer.saveParamters(inputValues);
    executionContext.openDataEngine();
synchronized (this) {
      if (!executionContext.isCanceled()) {
        documentBuilder=new ReportDocumentBuilder(executionContext,writer);
      }
    }
    if (documentBuilder != null) {
      if (pageHandler != null) {
        documentBuilder.setPageHandler(pageHandler);
      }
      IContentEmitter emitter=documentBuilder.getContentEmitter();
      IReportExecutor executor=new ReportExecutor(executionContext);
      executor=createReportExtensionExecutor(executor);
      executor=new ReportEmitterExecutor(executor,emitter);
      executor=new SuppressDuplciateReportExecutor(executor);
      if (executionContext.isFixedLayout()) {
        executor=new LocalizedReportExecutor(executionContext,executor);
      }
      executionContext.setExecutor(executor);
      initializeContentEmitter(emitter);
      documentBuilder.build();
    }
    executionContext.closeDataEngine();
  }
 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);
  }
 finally {
    documentBuilder=null;
    closeFactory();
    writer.savePersistentObjects(executionContext.getGlobalBeans());
    closeReportDocument();
    if (pageHandler != null && !executionContext.isCanceled()) {
      int totalPage=(int)executionContext.getTotalPage();
      IReportDocumentInfo docInfo=new ReportDocumentInfo(executionContext,totalPage,true);
      pageHandler.onPage(totalPage,true,docInfo);
    }
    if (progressMonitor != null) {
      progressMonitor.onProgress(IProgressMonitor.END_TASK,TASK_RUN);
    }
  }
}