Program: 77200
Project: 77200
Buggy source:
/** 
 * runs the report
 * @throws EngineException throws exception when there is a run error
 */
protected void doRun() throws EngineException {
  setRunningFlag(true);
  ReportRunnable report=executionContext.getRunnable();
  if (!validateParameters()) {
    setRunningFlag(false);
    throw new EngineException(MessageConstants.INVALID_PARAMETER_EXCEPTION);
  }
  loadDesign();
  prepareDesign();
  startFactory();
  openReportDocument();
  try {
    writer.saveDesign(report);
    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();
      ReportExecutor executor=new ReportExecutor(executionContext,report.getReportIR(),emitter);
      executionContext.setExecutor(executor);
      initializeContentEmitter(emitter,executor);
      documentBuilder.build();
    }
    executionContext.closeDataEngine();
    writer.savePersistentObjects(executionContext.getGlobalBeans());
  }
 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;
  }
 finally {
    documentBuilder=null;
    closeReportDocument();
    closeFactory();
    setRunningFlag(false);
  }
}

Fixed version (ground truth):
/** 
 * runs the report
 * @throws EngineException throws exception when there is a run error
 */
protected void doRun() throws EngineException {
  setRunningFlag(true);
  if (!validateParameters()) {
    setRunningFlag(false);
    throw new EngineException(MessageConstants.INVALID_PARAMETER_EXCEPTION);
  }
  loadDesign();
  prepareDesign();
  startFactory();
  openReportDocument();
  try {
    ReportRunnable report=executionContext.getRunnable();
    writer.saveDesign(report);
    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();
      ReportExecutor executor=new ReportExecutor(executionContext,report.getReportIR(),emitter);
      executionContext.setExecutor(executor);
      initializeContentEmitter(emitter,executor);
      documentBuilder.build();
    }
    executionContext.closeDataEngine();
    writer.savePersistentObjects(executionContext.getGlobalBeans());
  }
 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;
  }
 finally {
    documentBuilder=null;
    closeReportDocument();
    closeFactory();
    setRunningFlag(false);
  }
}