Program: 89522
Project: 89522
Buggy source:
/** 
 * Generate this section's part of the navigation tree (sidebar). This outputs balanced HTML to the JspWriter. It uses a locale to generate the right titles.
 * @param out A place to write our HTML
 * @param url The url of the page we're currently viewing. The list of subpages will only be displayed if the pagewe're viewing is one that belongs to this section.
 * @param locale The locale to generate the navigation tree for.
 * @throws IOException If there is a problem writing to the page.
 */
public void generateNavigationTree(JspWriter out,String url,Locale locale) throws IOException {
  String firstPage=pagesAndTitles.keySet().iterator().next();
  out.print("String_Node_Str");
  out.print("String_Node_Str" + HTMLUtils.encode(dirname) + "String_Node_Str"+ HTMLUtils.encode(firstPage)+ "String_Node_Str"+ HTMLUtils.escapeHtmlValues(I18n.getString(bundle,locale,mainname))+ "String_Node_Str");
  out.print("String_Node_Str");
  String page=getPage(url);
  if (page == null) {
    return;
  }
  if (pagesAndTitles.containsKey(page)) {
    int i=0;
    for (    Map.Entry<String,String> pageAndTitle : pagesAndTitles.entrySet()) {
      if (i == visiblePages) {
        break;
      }
      out.print("String_Node_Str");
      out.print("String_Node_Str" + HTMLUtils.encode(dirname) + "String_Node_Str"+ HTMLUtils.encode(pageAndTitle.getKey())+ "String_Node_Str"+ HTMLUtils.escapeHtmlValues(I18n.getString(bundle,locale,pageAndTitle.getValue()))+ "String_Node_Str");
      out.print("String_Node_Str");
      i++;
    }
    if (this.getClass().getName().equalsIgnoreCase("String_Node_Str")) {
      out.print("String_Node_Str");
      out.print("String_Node_Str" + HTMLUtils.encode(dirname) + "String_Node_Str"+ HTMLUtils.encode("String_Node_Str")+ "String_Node_Str"+ HTMLUtils.escapeHtmlValues(I18n.getString(bundle,locale,"String_Node_Str"))+ "String_Node_Str");
      out.print("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Generate this section's part of the navigation tree (sidebar). This outputs balanced HTML to the JspWriter. It uses a locale to generate the right titles.
 * @param out A place to write our HTML
 * @param url The url of the page we're currently viewing. The list of subpages will only be displayed if the pagewe're viewing is one that belongs to this section.
 * @param locale The locale to generate the navigation tree for.
 * @throws IOException If there is a problem writing to the page.
 */
public void generateNavigationTree(JspWriter out,String url,Locale locale) throws IOException {
  String firstPage=pagesAndTitles.keySet().iterator().next();
  out.print("String_Node_Str");
  out.print("String_Node_Str" + HTMLUtils.encode(dirname) + "String_Node_Str"+ HTMLUtils.encode(firstPage)+ "String_Node_Str"+ HTMLUtils.escapeHtmlValues(I18n.getString(bundle,locale,mainname))+ "String_Node_Str");
  out.print("String_Node_Str");
  String page=getPage(url);
  if (page == null) {
    return;
  }
  if (pagesAndTitles.containsKey(page)) {
    int i=0;
    for (    Map.Entry<String,String> pageAndTitle : pagesAndTitles.entrySet()) {
      if (i == visiblePages) {
        break;
      }
      out.print("String_Node_Str");
      out.print("String_Node_Str" + HTMLUtils.encode(dirname) + "String_Node_Str"+ pageAndTitle.getKey()+ "String_Node_Str"+ HTMLUtils.escapeHtmlValues(I18n.getString(bundle,locale,pageAndTitle.getValue()))+ "String_Node_Str");
      out.print("String_Node_Str");
      i++;
    }
  }
}