Program: 70893
Project: 70893
Buggy source:
/** 
 * @throws BirtException
 * @throws Exception
 * @throws IOException
 */
private void __processWithDiv() throws BirtException, Exception, IOException {
  if (!reportServiceInitialized) {
    initializeReportService();
  }
  HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
  IViewingSession session=ViewingSessionUtil.createSession(request);
  session.lock();
  try {
    this.options=new InputOptions();
    options.setOption(InputOptions.OPT_REQUEST,request);
    options.setOption(InputOptions.OPT_LOCALE,this.locale);
    options.setOption(InputOptions.OPT_TIMEZONE,this.timeZone);
    options.setOption(InputOptions.OPT_RTL,Boolean.valueOf(viewer.getRtl()));
    options.setOption(InputOptions.OPT_IS_MASTER_PAGE_CONTENT,Boolean.valueOf(viewer.getAllowMasterPage()));
    options.setOption(InputOptions.OPT_SVG_FLAG,Boolean.valueOf(viewer.getSvg()));
    options.setOption(InputOptions.OPT_FORMAT,outputFormat);
    options.setOption(InputOptions.OPT_EMITTER_ID,emitterId);
    options.setOption(InputOptions.OPT_IS_DESIGNER,new Boolean(false));
    options.setOption(InputOptions.OPT_SERVLET_PATH,IBirtConstants.SERVLET_PATH_PREVIEW);
    options.setOption(InputOptions.OPT_PAGE_OVERFLOW,viewer.getPageOverflow());
    reportDesignHandle=BirtTagUtil.getDesignHandle(request,viewer);
    if (viewer.isHostPage()) {
      HttpServletResponse response=(HttpServletResponse)pageContext.getResponse();
      __handleOutputReport(response.getOutputStream(),session);
    }
 else {
      ByteArrayOutputStream out=new ByteArrayOutputStream();
      __handleOutputReport(out,session);
      String content=out.toString();
      JspWriter writer=pageContext.getOut();
      writer.write(__handleStyle(content));
      writer.write(__handleScript(content));
      writer.write("String_Node_Str" + viewer.getId() + "String_Node_Str"+ __handleDivAppearance()+ "String_Node_Str");
      writer.write("String_Node_Str" + __handleBodyStyle(content) + "String_Node_Str");
      writer.write(__handleBody(content) + "String_Node_Str");
      writer.write("String_Node_Str");
      writer.write("String_Node_Str");
    }
  }
  finally {
    session.unlock();
  }
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 * @throws Exception
 * @throws IOException
 */
private void __processWithDiv() throws BirtException, Exception, IOException {
  if (!reportServiceInitialized) {
    initializeReportService();
  }
  HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
  IViewingSession session=ViewingSessionUtil.createSession(request);
  session.lock();
  try {
    this.options=new InputOptions();
    options.setOption(InputOptions.OPT_REQUEST,request);
    options.setOption(InputOptions.OPT_LOCALE,this.locale);
    options.setOption(InputOptions.OPT_TIMEZONE,this.timeZone);
    options.setOption(InputOptions.OPT_RTL,Boolean.valueOf(viewer.getRtl()));
    options.setOption(InputOptions.OPT_IS_MASTER_PAGE_CONTENT,Boolean.valueOf(viewer.getAllowMasterPage()));
    options.setOption(InputOptions.OPT_SVG_FLAG,Boolean.valueOf(viewer.getSvg()));
    options.setOption(InputOptions.OPT_FORMAT,outputFormat);
    options.setOption(InputOptions.OPT_EMITTER_ID,emitterId);
    options.setOption(InputOptions.OPT_IS_DESIGNER,Boolean.valueOf(false));
    options.setOption(InputOptions.OPT_SERVLET_PATH,IBirtConstants.SERVLET_PATH_PREVIEW);
    options.setOption(InputOptions.OPT_PAGE_OVERFLOW,viewer.getPageOverflow());
    reportDesignHandle=BirtTagUtil.getDesignHandle(request,viewer);
    if (viewer.isHostPage()) {
      HttpServletResponse response=(HttpServletResponse)pageContext.getResponse();
      __handleOutputReport(response.getOutputStream(),session);
    }
 else {
      ByteArrayOutputStream out=new ByteArrayOutputStream();
      __handleOutputReport(out,session);
      String content=out.toString();
      JspWriter writer=pageContext.getOut();
      writer.write(__handleStyle(content));
      writer.write(__handleScript(content));
      writer.write("String_Node_Str" + viewer.getId() + "String_Node_Str"+ __handleDivAppearance()+ "String_Node_Str");
      writer.write("String_Node_Str" + __handleBodyStyle(content) + "String_Node_Str");
      writer.write(__handleBody(content) + "String_Node_Str");
      writer.write("String_Node_Str");
      writer.write("String_Node_Str");
    }
  }
  finally {
    session.unlock();
  }
}