Program: 78964
Project: 78964
Buggy source:
public void run() throws EngineException {
  ReportDesignHandle designHandle=(ReportDesignHandle)runnable.getDesignHandle();
  ReportDesignHandle copiedDesignHandle=designHandle;
  if (!validateParameters()) {
    throw new EngineException(MessageConstants.INVALID_PARAMETER_EXCEPTION);
  }
  EngineEmitterServices services=new EngineEmitterServices(this);
  services.setRenderOption(renderOption);
  EngineConfig config=engine.getConfig();
  if (config != null)   services.setEmitterConfig(engine.getConfig().getEmitterConfigs());
  services.setRenderContext(context);
  services.setReportRunnable(runnable);
  usingParameterValues();
  ReportContextImpl reportContext=new ReportContextImpl(executionContext.getParams(),config.getConfigMap(),executionContext.getAppContext());
  executionContext.setReportContext(reportContext);
  ScriptedDesignVisitor visitor=new ScriptedDesignVisitor(copiedDesignHandle,executionContext);
  visitor.apply(copiedDesignHandle.getRoot());
  executionContext.getConfigs().putAll(runnable.getTestConfig());
  executionContext.getConfigs().putAll(System.getProperties());
  executionContext.setRenderOption(renderOption);
  String format=renderOption.getOutputFormat();
  if (format == null || format.length() == 0) {
    renderOption.setOutputFormat("String_Node_Str");
    format="String_Node_Str";
  }
 else   if (renderOption != null && format.equalsIgnoreCase("String_Node_Str") && ((FORenderOption)renderOption).getTailoredForFOP()) {
    format="String_Node_Str";
  }
  if (!ExtensionManager.getInstance().getEmitterExtensions().containsKey(format)) {
    log.log(Level.SEVERE,MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
    throw new EngineException(MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
  }
  IContentEmitter emitter=ExtensionManager.getInstance().createEmitter(format);
  if (emitter == null) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION);
  }
  ReportExecutor executor=new ReportExecutor(executionContext);
  emitter=new LocalizedEmitter(executionContext,emitter);
  emitter=new HtmlPaginateEmitter(executor,emitter);
  emitter.initialize(services);
  try {
    Report report=new ReportParser().parse(((ReportRunnable)runnable).getReport());
    executor.execute(report,emitter);
  }
 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):
public void run() throws EngineException {
  ReportDesignHandle designHandle=(ReportDesignHandle)runnable.getDesignHandle();
  ReportDesignHandle copiedDesignHandle=designHandle;
  if (!validateParameters()) {
    throw new EngineException(MessageConstants.INVALID_PARAMETER_EXCEPTION);
  }
  EngineEmitterServices services=new EngineEmitterServices(this);
  services.setRenderOption(renderOption);
  EngineConfig config=engine.getConfig();
  if (config != null)   services.setEmitterConfig(engine.getConfig().getEmitterConfigs());
  services.setRenderContext(context);
  services.setReportRunnable(runnable);
  usingParameterValues();
  ReportContextImpl reportContext=new ReportContextImpl(executionContext.getParams(),config.getConfigMap(),executionContext.getAppContext());
  executionContext.setReportContext(reportContext);
  ScriptedDesignVisitor visitor=new ScriptedDesignVisitor(copiedDesignHandle,executionContext);
  visitor.apply(copiedDesignHandle.getRoot());
  executionContext.getConfigs().putAll(runnable.getTestConfig());
  executionContext.getConfigs().putAll(System.getProperties());
  executionContext.setRenderOption(renderOption);
  String format=renderOption.getOutputFormat();
  if (format == null || format.length() == 0) {
    renderOption.setOutputFormat("String_Node_Str");
    format="String_Node_Str";
  }
 else   if (renderOption != null && format.equalsIgnoreCase("String_Node_Str") && ((FORenderOption)renderOption).getTailoredForFOP()) {
    format="String_Node_Str";
  }
  if (!ExtensionManager.getInstance().getEmitterExtensions().containsKey(format)) {
    log.log(Level.SEVERE,MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
    throw new EngineException(MessageConstants.FORMAT_NOT_SUPPORTED_EXCEPTION,format);
  }
  IContentEmitter emitter=ExtensionManager.getInstance().createEmitter(format);
  if (emitter == null) {
    log.log(Level.SEVERE,"String_Node_Str",format);
    throw new EngineException(MessageConstants.CANNOT_CREATE_EMITTER_EXCEPTION);
  }
  ReportExecutor executor=new ReportExecutor(executionContext);
  services.setExecutor(executor);
  emitter=new LocalizedEmitter(executionContext,emitter);
  emitter=new HtmlPaginateEmitter(executor,emitter);
  emitter.initialize(services);
  try {
    Report report=new ReportParser().parse(((ReportRunnable)runnable).getReport());
    executor.execute(report,emitter);
  }
 catch (  Exception ex) {
    log.log(Level.SEVERE,"String_Node_Str",ex);
  }
catch (  OutOfMemoryError err) {
    log.log(Level.SEVERE,"String_Node_Str");
    throw err;
  }
}