Program: 76428
Project: 76428
Buggy source:
/** 
 * Render report page.
 * @param os
 * @param request
 * @param reportDocument
 * @param pageNumber
 * @param pageRange
 * @param masterPage
 * @param svgFlag
 * @param activeIds
 * @param locale
 * @param rtl
 * @param iServletPath
 * @throws RemoteException
 */
public void renderReport(OutputStream os,HttpServletRequest request,IReportDocument reportDocument,long pageNumber,String pageRange,boolean masterPage,boolean svgFlag,List activeIds,Locale locale,boolean rtl,String iServletPath) throws RemoteException {
}

Fixed version (ground truth):
/** 
 * Render report page.
 * @param os
 * @param request
 * @param reportDocument
 * @param pageNumber
 * @param pageRange
 * @param masterPage
 * @param svgFlag
 * @param activeIds
 * @param locale
 * @param rtl
 * @param iServletPath
 * @throws RemoteException
 */
public void renderReport(OutputStream os,HttpServletRequest request,IReportDocument reportDocument,long pageNumber,String pageRange,boolean masterPage,boolean svgFlag,List activeIds,Locale locale,boolean rtl,String iServletPath) throws RemoteException {
  if (reportDocument == null) {
    AxisFault fault=new AxisFault(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_NO_REPORT_DOCUMENT));
    fault.setFaultCode(new QName("String_Node_Str"));
    throw fault;
  }
  OutputStream out=os;
  if (out == null)   out=new ByteArrayOutputStream();
  String servletPath=iServletPath;
  if (servletPath == null)   servletPath=request.getServletPath();
  IRenderTask renderTask=engine.createRenderTask(reportDocument);
  BirtUtility.addTask(request,renderTask);
  HashMap context=new HashMap();
  String format=ParameterAccessor.getFormat(request);
  if (format.equalsIgnoreCase(ParameterAccessor.PARAM_FORMAT_PDF)) {
    context.put(EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT,createPDFrenderContext(request.getServletPath(),ParameterAccessor.isDesigner(request)));
  }
 else {
    context.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,createHTMLrenderContext(svgFlag,servletPath,request));
  }
  context.put(EngineConstants.APPCONTEXT_BIRT_VIEWER_HTTPSERVET_REQUEST,request);
  context.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,ReportEngineService.class.getClassLoader());
  ParameterAccessor.pushAppContext(context,request);
  renderTask.setAppContext(context);
  HTMLRenderOption setting=new HTMLRenderOption();
  setting.setOutputStream(out);
  setting.setOutputFormat(format);
  ViewerHTMLActionHandler handler=null;
  if (format.equalsIgnoreCase(ParameterAccessor.PARAM_FORMAT_PDF)) {
    handler=new ViewerHTMLActionHandler(reportDocument,pageNumber,locale,false,rtl,masterPage,format);
  }
 else {
    boolean isEmbeddable=false;
    if (IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(servletPath) || IBirtConstants.SERVLET_PATH_RUN.equalsIgnoreCase(servletPath))     isEmbeddable=true;
    setting.setEmbeddable(isEmbeddable);
    setting.setHtmlRtLFlag(rtl);
    setting.setInstanceIDs(activeIds);
    setting.setMasterPageContent(masterPage);
    handler=new ViewerHTMLActionHandler(reportDocument,pageNumber,locale,isEmbeddable,rtl,masterPage,format);
  }
  String resourceFolder=ParameterAccessor.getParameter(request,ParameterAccessor.PARAM_RESOURCE_FOLDER);
  handler.setResourceFolder(resourceFolder);
  setting.setActionHandle(handler);
  renderTask.setRenderOption(setting);
  renderTask.setLocale(locale);
  initializeEmitterConfigs(request,setting.getOutputSetting());
  try {
    if (pageNumber > 0)     renderTask.setPageNumber(pageNumber);
    if (!IBirtConstants.SERVLET_PATH_FRAMESET.equalsIgnoreCase(servletPath) && pageRange != null)     renderTask.setPageRange(pageRange);
    renderTask.render();
  }
 catch (  Exception e) {
    AxisFault fault=new AxisFault(e.getLocalizedMessage(),e);
    fault.setFaultCode(new QName("String_Node_Str"));
    fault.setFaultString(e.getLocalizedMessage());
    throw fault;
  }
 finally {
    BirtUtility.removeTask(request);
    renderTask.close();
  }
}