Program: 76722
Project: 76722
Buggy source:
/** 
 * Create the final URI string to preview report
 * @param iPattern
 * @return
 */
public String createURI(String iPattern){
  String uri=iPattern;
  if (uri == null)   uri=this.pattern;
  if (uri == null) {
    uri=IBirtConstants.VIEWER_FRAMESET;
    if ((reportDocument != null && reportletId != null) || !allowPageBreak) {
      uri=IBirtConstants.VIEWER_RUN;
    }
  }
  if (contextRoot != null)   uri="String_Node_Str" + contextRoot + "String_Node_Str"+ uri;
  if (format != null) {
    uri+="String_Node_Str" + ParameterAccessor.PARAM_FORMAT + "String_Node_Str"+ urlParamValueEncode(format);
  }
 else {
    uri+="String_Node_Str" + ParameterAccessor.PARAM_FORMAT + "String_Node_Str"+ ParameterAccessor.PARAM_FORMAT_HTML;
  }
  if (reportDesign != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_REPORT + "String_Node_Str"+ urlParamValueEncode(reportDesign);
  if (reportDocument != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_REPORT_DOCUMENT + "String_Node_Str"+ urlParamValueEncode(reportDocument);
  if (reportletId != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_INSTANCEID + "String_Node_Str"+ urlParamValueEncode(reportletId);
  if (allowPageBreak && id != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_ID + "String_Node_Str"+ urlParamValueEncode(id);
  if (allowPageBreak && title != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_TITLE + "String_Node_Str"+ urlParamValueEncode(title);
  if (allowPageBreak && showTitle != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_SHOW_TITLE + "String_Node_Str"+ urlParamValueEncode(showTitle);
  if (bookmark != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_BOOKMARK + "String_Node_Str"+ urlParamValueEncode(bookmark);
  if (!isCustom && pattern != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_SERVLET_PATTERN + "String_Node_Str"+ urlParamValueEncode(pattern);
  if (!isCustom && target != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_TARGET + "String_Node_Str"+ urlParamValueEncode(target);
  if (locale != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_LOCALE + "String_Node_Str"+ urlParamValueEncode(locale);
  if (svg != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_SVG + "String_Node_Str"+ urlParamValueEncode(svg);
  if (rtl != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_RTL + "String_Node_Str"+ urlParamValueEncode(rtl);
  if (allowMasterPage != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_MASTERPAGE + "String_Node_Str"+ urlParamValueEncode(allowMasterPage);
  if (resourceFolder != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_RESOURCE_FOLDER + "String_Node_Str"+ urlParamValueEncode(resourceFolder);
  if (maxRowsOfRecords >= 0)   uri+="String_Node_Str" + ParameterAccessor.PARAM_MAXROWS + "String_Node_Str"+ maxRowsOfRecords;
  if (forceOverwriteDocument != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_OVERWRITE + "String_Node_Str"+ urlParamValueEncode(forceOverwriteDocument);
  if (forceParameterPrompting != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_PARAMETER_PROMPTING + "String_Node_Str"+ urlParamValueEncode(forceParameterPrompting);
  if (showToolBar != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_TOOLBAR + "String_Node_Str"+ urlParamValueEncode(showToolBar);
  if (showNavigationBar != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_NAVIGATIONBAR + "String_Node_Str"+ urlParamValueEncode(showNavigationBar);
  return uri;
}

Fixed version (ground truth):
/** 
 * Create the final URI string to preview report
 * @param iPattern
 * @return
 */
public String createURI(String iPattern){
  String uri=iPattern;
  if (uri == null)   uri=this.pattern;
  if (uri == null) {
    uri=IBirtConstants.VIEWER_FRAMESET;
    if ((reportDocument != null && reportletId != null) || !allowPageBreak) {
      uri=IBirtConstants.VIEWER_RUN;
    }
  }
  if (contextRoot != null)   uri="String_Node_Str" + contextRoot + "String_Node_Str"+ uri;
  if (format != null) {
    uri+="String_Node_Str" + ParameterAccessor.PARAM_FORMAT + "String_Node_Str"+ urlParamValueEncode(format);
  }
 else {
    uri+="String_Node_Str" + ParameterAccessor.PARAM_FORMAT + "String_Node_Str"+ ParameterAccessor.PARAM_FORMAT_HTML;
  }
  if (reportDesign != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_REPORT + "String_Node_Str"+ urlParamValueEncode(reportDesign);
  if (reportDocument != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_REPORT_DOCUMENT + "String_Node_Str"+ urlParamValueEncode(reportDocument);
  if (reportletId != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_INSTANCEID + "String_Node_Str"+ urlParamValueEncode(reportletId);
  if (allowPageBreak && id != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_ID + "String_Node_Str"+ urlParamValueEncode(id);
  if (allowPageBreak && title != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_TITLE + "String_Node_Str"+ urlParamValueEncode(title);
  if (allowPageBreak && showTitle != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_SHOW_TITLE + "String_Node_Str"+ urlParamValueEncode(showTitle);
  if (!isCustom && pattern != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_SERVLET_PATTERN + "String_Node_Str"+ urlParamValueEncode(pattern);
  if (!isCustom && target != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_TARGET + "String_Node_Str"+ urlParamValueEncode(target);
  if (locale != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_LOCALE + "String_Node_Str"+ urlParamValueEncode(locale);
  if (svg != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_SVG + "String_Node_Str"+ urlParamValueEncode(svg);
  if (rtl != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_RTL + "String_Node_Str"+ urlParamValueEncode(rtl);
  if (allowMasterPage != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_MASTERPAGE + "String_Node_Str"+ urlParamValueEncode(allowMasterPage);
  if (resourceFolder != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_RESOURCE_FOLDER + "String_Node_Str"+ urlParamValueEncode(resourceFolder);
  if (maxRowsOfRecords >= 0)   uri+="String_Node_Str" + ParameterAccessor.PARAM_MAXROWS + "String_Node_Str"+ maxRowsOfRecords;
  if (forceOverwriteDocument != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_OVERWRITE + "String_Node_Str"+ urlParamValueEncode(forceOverwriteDocument);
  if (forceParameterPrompting != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_PARAMETER_PROMPTING + "String_Node_Str"+ urlParamValueEncode(forceParameterPrompting);
  if (showToolBar != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_TOOLBAR + "String_Node_Str"+ urlParamValueEncode(showToolBar);
  if (showNavigationBar != null)   uri+="String_Node_Str" + ParameterAccessor.PARAM_NAVIGATIONBAR + "String_Node_Str"+ urlParamValueEncode(showNavigationBar);
  if (bookmark != null) {
    if (IBirtConstants.VIEWER_PREVIEW.equalsIgnoreCase(iPattern)) {
      uri+="String_Node_Str" + urlParamValueEncode(bookmark);
    }
 else {
      uri+="String_Node_Str" + ParameterAccessor.PARAM_BOOKMARK + "String_Node_Str"+ urlParamValueEncode(bookmark);
    }
  }
  return uri;
}