Program: 77559
Project: 77559
Buggy source:
/** 
 * @param offset the offset of the reportlet to be rendered
 * @throws EngineException throws exception if there is a rendering error
 */
protected void doRenderReportlet(long offset) throws OutOfMemoryError {
  try {
    if (offset != -1) {
      IContentEmitter emitter=createContentEmitter();
      ReportDesignHandle reportDesign=executionContext.getDesign();
      String format=executionContext.getOutputFormat();
      if ("String_Node_Str".equalsIgnoreCase(format)) {
        IReportExecutor executor=new ReportletReader(executionContext,offset);
        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,false);
        closeRender();
        executor.close();
      }
 else {
        ReportContentLoader loader=new ReportContentLoader(executionContext);
        IReportExecutor executor=new ReportExecutor(executionContext,reportDesign,null);
        executor=new LocalizedReportExecutor(executionContext,executor);
        executionContext.setExecutor(executor);
        initializeContentEmitter(emitter,executor);
        startRender();
        loader.loadReportlet(offset,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 offset the offset of the reportlet to be rendered
 * @throws EngineException throws exception if there is a rendering error
 */
protected void doRenderReportlet(long offset) throws EngineException {
  try {
    if (offset != -1) {
      IContentEmitter emitter=createContentEmitter();
      ReportDesignHandle reportDesign=executionContext.getDesign();
      String format=executionContext.getOutputFormat();
      if ("String_Node_Str".equalsIgnoreCase(format)) {
        IReportExecutor executor=new ReportletReader(executionContext,offset);
        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,false);
        closeRender();
        executor.close();
      }
 else {
        ReportContentLoader loader=new ReportContentLoader(executionContext);
        IReportExecutor executor=new ReportExecutor(executionContext,reportDesign,null);
        executor=new LocalizedReportExecutor(executionContext,executor);
        executionContext.setExecutor(executor);
        initializeContentEmitter(emitter,executor);
        startRender();
        loader.loadReportlet(offset,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;
  }
}