Program: 77820
Project: 77820
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) {
    if (context instanceof HTMLRenderContext) {
      baseURL=((HTMLRenderContext)context).getBaseURL();
    }
    if (context instanceof PDFRenderContext) {
      baseURL=((PDFRenderContext)context).getBaseURL();
    }
  }
  if (baseURL == null) {
    baseURL="String_Node_Str";
  }
  StringBuffer link=new StringBuffer();
  String reportName=action.getReportName();
  if (reportName != null && !reportName.equals("String_Node_Str")) {
    String format=action.getFormat();
    if (!"String_Node_Str".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,"String_Node_Str"));
    }
 catch (    UnsupportedEncodingException e1) {
    }
    if (format != null && format.length() > 0) {
      link.append("String_Node_Str" + 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("String_Node_Str" + URLEncoder.encode(key,"String_Node_Str") + "String_Node_Str"+ URLEncoder.encode(value,"String_Node_Str"));
          }
        }
 catch (        UnsupportedEncodingException e) {
        }
      }
    }
    link.append("String_Node_Str");
    if (action.getBookmark() != null) {
      try {
        if (baseURL.lastIndexOf("String_Node_Str") > 0) {
          link.append("String_Node_Str");
        }
 else {
          link.append("String_Node_Str");
        }
        link.append(URLEncoder.encode(action.getBookmark(),"String_Node_Str"));
      }
 catch (      UnsupportedEncodingException e) {
      }
    }
  }
  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) {
    if (context instanceof HTMLRenderContext) {
      baseURL=((HTMLRenderContext)context).getBaseURL();
    }
    if (context instanceof PDFRenderContext) {
      baseURL=((PDFRenderContext)context).getBaseURL();
    }
  }
  if (baseURL == null) {
    baseURL="String_Node_Str";
  }
  StringBuffer link=new StringBuffer();
  String reportName=action.getReportName();
  if (reportName != null && !reportName.equals("String_Node_Str")) {
    String format=action.getFormat();
    if (!"String_Node_Str".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,"String_Node_Str"));
    }
 catch (    UnsupportedEncodingException e1) {
    }
    if (format != null && format.length() > 0) {
      link.append("String_Node_Str" + 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=ParameterValidationUtil.getDisplayValue(valueObj);
            link.append("String_Node_Str" + URLEncoder.encode(key,"String_Node_Str") + "String_Node_Str"+ URLEncoder.encode(value,"String_Node_Str"));
          }
        }
 catch (        UnsupportedEncodingException e) {
        }
      }
    }
    link.append("String_Node_Str");
    if (action.getBookmark() != null) {
      try {
        if (baseURL.lastIndexOf("String_Node_Str") > 0) {
          link.append("String_Node_Str");
        }
 else {
          link.append("String_Node_Str");
        }
        link.append(URLEncoder.encode(action.getBookmark(),"String_Node_Str"));
      }
 catch (      UnsupportedEncodingException e) {
      }
    }
  }
  return link.toString();
}