Program: 76692
Project: 76692
Buggy source:
/** 
 * process tag function
 * @see org.eclipse.birt.report.taglib.AbstractBaseTag#__process()
 */
public void __process() throws Exception {
  outputFormat=BirtTagUtil.getFormat(viewer.getFormat());
  if (!outputFormat.equalsIgnoreCase(ParameterAccessor.PARAM_FORMAT_HTML) || BirtTagUtil.convertToBoolean(viewer.getForceParameterPrompting()) || viewer.isForceIFrame()|| isContextChanged(viewer.getContextRoot())) {
    __handleIFrame(viewer.createURI(IBirtConstants.VIEWER_PREVIEW),viewer.getId());
    return;
  }
  this.options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,(HttpServletRequest)pageContext.getRequest());
  options.setOption(InputOptions.OPT_LOCALE,this.locale);
  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_IS_DESIGNER,new Boolean(false));
  options.setOption(InputOptions.OPT_SERVLET_PATH,IBirtConstants.SERVLET_PATH_PREVIEW);
  BirtReportServiceFactory.getReportService().setContext(pageContext.getServletContext(),this.options);
  reportDesignHandle=getDesignHandle();
  Collection parameterDefList=getReportService().getParameterDefinitions(this.reportDesignHandle,options,false);
  if (BirtUtility.validateParameters(parameterDefList,getParameterMap())) {
    __handleIFrame(viewer.createURI(IBirtConstants.VIEWER_PREVIEW),viewer.getId());
  }
 else {
    ByteArrayOutputStream out=new ByteArrayOutputStream();
    __handleOutputReport(out);
    String content=out.toString();
    JspWriter writer=pageContext.getOut();
    if (viewer.isHostPage()) {
      writer.write(content);
    }
 else {
      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");
    }
  }
}

Fixed version (ground truth):
/** 
 * process tag function
 * @see org.eclipse.birt.report.taglib.AbstractBaseTag#__process()
 */
public void __process() throws Exception {
  outputFormat=BirtTagUtil.getFormat(viewer.getFormat());
  if (!outputFormat.equalsIgnoreCase(ParameterAccessor.PARAM_FORMAT_HTML) || BirtTagUtil.convertToBoolean(viewer.getForceParameterPrompting()) || viewer.isForceIFrame()|| isContextChanged(viewer.getContextRoot())) {
    __processWithIFrame();
    return;
  }
  this.options=new InputOptions();
  options.setOption(InputOptions.OPT_REQUEST,(HttpServletRequest)pageContext.getRequest());
  options.setOption(InputOptions.OPT_LOCALE,this.locale);
  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_IS_DESIGNER,new Boolean(false));
  options.setOption(InputOptions.OPT_SERVLET_PATH,IBirtConstants.SERVLET_PATH_PREVIEW);
  BirtReportServiceFactory.getReportService().setContext(pageContext.getServletContext(),this.options);
  reportDesignHandle=getDesignHandle();
  Collection parameterDefList=getReportService().getParameterDefinitions(this.reportDesignHandle,options,false);
  if (BirtUtility.validateParameters(parameterDefList,getParameterMap())) {
    __processWithIFrame();
  }
 else {
    if (viewer.isHostPage()) {
      HttpServletResponse response=(HttpServletResponse)pageContext.getResponse();
      __handleOutputReport(response.getOutputStream());
    }
 else {
      ByteArrayOutputStream out=new ByteArrayOutputStream();
      __handleOutputReport(out);
      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");
    }
  }
}