Program: 77830
Project: 77830
Buggy source:
/** 
 * builds URL for drillthrough action
 * @param action instance of the IAction instance
 * @param context the context for building the action string
 * @return a URL
 */
protected String buildDrillAction(IAction action,Object context){
  String baseURL=null;
  if (context != null && context instanceof HTMLRenderContext) {
    baseURL=((HTMLRenderContext)context).getBaseURL();
  }
  StringBuffer link=new StringBuffer();
  String reportName=action.getReportName();
  if (reportName != null && !reportName.equals("String_Node_Str")) {
    String format=action.getFormat();
    if (ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format)) {
      link.append(baseURL.replaceFirst("String_Node_Str","String_Node_Str"));
    }
 else {
      link.append(baseURL);
    }
    link.append(reportName.toLowerCase().endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str");
    try {
      link.append(URLEncoder.encode(reportName,ParameterAccessor.UTF_8_ENCODE));
    }
 catch (    UnsupportedEncodingException e1) {
    }
    if (format != null && format.length() > 0) {
      link.append(ParameterAccessor.getQueryParameterString(ParameterAccessor.PARAM_FORMAT,format));
    }
    if (action.getParameterBindings() != null) {
      Iterator paramsIte=action.getParameterBindings().entrySet().iterator();
      while (paramsIte.hasNext()) {
        Map.Entry entry=(Map.Entry)paramsIte.next();
        try {
          String key=(String)entry.getKey();
          Object valueObj=entry.getValue();
          if (valueObj != null) {
            String value=valueObj.toString();
            link.append(ParameterAccessor.getQueryParameterString(URLEncoder.encode(key,ParameterAccessor.UTF_8_ENCODE),URLEncoder.encode(value,ParameterAccessor.UTF_8_ENCODE)));
          }
        }
 catch (        UnsupportedEncodingException e) {
        }
      }
    }
    link.append(ParameterAccessor.getQueryParameterString(ParameterAccessor.PARAM_OVERWRITE,String.valueOf(true)));
    if (!ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format) && action.getBookmark() != null) {
      try {
        link.append(ParameterAccessor.getQueryParameterString(ParameterAccessor.PARAM_BOOKMARK,URLEncoder.encode(action.getBookmark(),ParameterAccessor.UTF_8_ENCODE)));
      }
 catch (      UnsupportedEncodingException e) {
      }
    }
  }
  if (locale != null) {
    link.append(ParameterAccessor.getQueryParameterString(ParameterAccessor.PARAM_LOCALE,locale.toString()));
  }
  if (isRtl) {
    link.append(ParameterAccessor.getQueryParameterString(ParameterAccessor.PARAM_RTL,String.valueOf(isRtl)));
  }
  return link.toString();
}

Fixed version (ground truth):
/** 
 * builds URL for drillthrough action
 * @param action instance of the IAction instance
 * @param context the context for building the action string
 * @return a URL
 */
protected String buildDrillAction(IAction action,Object context){
  String baseURL=null;
  if (context != null && context instanceof HTMLRenderContext) {
    baseURL=((HTMLRenderContext)context).getBaseURL();
  }
  StringBuffer link=new StringBuffer();
  String reportName=action.getReportName();
  if (reportName != null && !reportName.equals("String_Node_Str")) {
    String format=action.getFormat();
    if (ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format)) {
      link.append(baseURL.replaceFirst("String_Node_Str","String_Node_Str"));
    }
 else {
      link.append(baseURL);
    }
    link.append(reportName.toLowerCase().endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str");
    try {
      link.append(URLEncoder.encode(reportName,ParameterAccessor.UTF_8_ENCODE));
    }
 catch (    UnsupportedEncodingException e1) {
    }
    if (format != null && format.length() > 0) {
      link.append(ParameterAccessor.getQueryParameterString(ParameterAccessor.PARAM_FORMAT,format));
    }
    if (action.getParameterBindings() != null) {
      Iterator paramsIte=action.getParameterBindings().entrySet().iterator();
      while (paramsIte.hasNext()) {
        Map.Entry entry=(Map.Entry)paramsIte.next();
        try {
          String key=(String)entry.getKey();
          Object valueObj=entry.getValue();
          if (valueObj != null) {
            String value=valueObj.toString();
            link.append(ParameterAccessor.getQueryParameterString(URLEncoder.encode(key,ParameterAccessor.UTF_8_ENCODE),URLEncoder.encode(value,ParameterAccessor.UTF_8_ENCODE)));
          }
        }
 catch (        UnsupportedEncodingException e) {
        }
      }
    }
    link.append(ParameterAccessor.getQueryParameterString(ParameterAccessor.PARAM_OVERWRITE,String.valueOf(true)));
    if (!ParameterAccessor.PARAM_FORMAT_PDF.equalsIgnoreCase(format) && action.getBookmark() != null) {
      try {
        link.append(ParameterAccessor.getQueryParameterString(ParameterAccessor.PARAM_BOOKMARK,URLEncoder.encode(action.getBookmark(),ParameterAccessor.UTF_8_ENCODE)));
      }
 catch (      UnsupportedEncodingException e) {
      }
      if (!action.isBookmark()) {
        link.append(ParameterAccessor.getQueryParameterString(ParameterAccessor._TOC,String.valueOf(true)));
      }
    }
  }
  if (locale != null) {
    link.append(ParameterAccessor.getQueryParameterString(ParameterAccessor.PARAM_LOCALE,locale.toString()));
  }
  if (isRtl) {
    link.append(ParameterAccessor.getQueryParameterString(ParameterAccessor.PARAM_RTL,String.valueOf(isRtl)));
  }
  return link.toString();
}