Program: 44781
Project: 44781
Buggy source:
private String generatePaginator(){
  boolean in_leading_range=false;
  boolean in_trailing_range=false;
  List<Integer> pages_outside_leading_range=new ArrayList<Integer>();
  List<Integer> pages_outside_trailing_range=new ArrayList<Integer>();
  List<Integer> page_numbers;
  if (totalPages <= LEADING_PAGE_RANGE_DISPLAYED) {
    in_leading_range=in_trailing_range=true;
    page_numbers=Functions.range(1,totalPages + 1);
  }
 else   if (currentPage <= LEADING_PAGE_RANGE) {
    in_leading_range=true;
    page_numbers=Functions.range(1,LEADING_PAGE_RANGE_DISPLAYED + 1);
    pages_outside_leading_range=Functions.range(0,-NUM_PAGES_OUTSIDE_RANGE,totalPages);
  }
 else   if (currentPage > totalPages - TRAILING_PAGE_RANGE) {
    in_trailing_range=true;
    page_numbers=Functions.range(totalPages - TRAILING_PAGE_RANGE_DISPLAYED + 1,totalPages + 1);
    pages_outside_trailing_range=Functions.range(0,NUM_PAGES_OUTSIDE_RANGE,1);
  }
 else {
    page_numbers=Functions.range(currentPage - ADJACENT_PAGES,currentPage + ADJACENT_PAGES + 1);
    pages_outside_leading_range=Functions.range(0,-NUM_PAGES_OUTSIDE_RANGE,totalPages);
    pages_outside_trailing_range=Functions.range(0,NUM_PAGES_OUTSIDE_RANGE,1);
  }
  StringBuilder html=new StringBuilder();
  html.append("String_Node_Str");
  if (currentPage > 1) {
    html.append("String_Node_Str");
    html.append(url);
    html.append("String_Node_Str" + Integer.toString(currentPage - 1));
    html.append("String_Node_Str" + Integer.toString(pageSize));
    html.append("String_Node_Str");
  }
 else {
    html.append("String_Node_Str");
  }
  if (!in_leading_range) {
    for (    Integer num : pages_outside_trailing_range) {
      html.append("String_Node_Str");
      html.append(url);
      html.append("String_Node_Str" + Integer.toString(num));
      html.append("String_Node_Str" + Integer.toString(pageSize));
      html.append("String_Node_Str");
      html.append(Integer.toString(num));
      html.append("String_Node_Str");
    }
    html.append("String_Node_Str");
  }
  if (page_numbers.size() > 0) {
    for (    Integer num : page_numbers) {
      if (num <= totalPages) {
        if (currentPage.equals(num)) {
          html.append("String_Node_Str");
          html.append(Integer.toString(num));
          html.append("String_Node_Str");
        }
 else {
          html.append("String_Node_Str");
          html.append(url);
          html.append("String_Node_Str" + Integer.toString(num));
          html.append("String_Node_Str" + Integer.toString(pageSize));
          html.append("String_Node_Str");
          html.append(Integer.toString(num));
          html.append("String_Node_Str");
        }
      }
    }
  }
 else {
    html.append("String_Node_Str");
  }
  Collections.reverse(pages_outside_leading_range);
  if (!in_trailing_range) {
    html.append("String_Node_Str");
    for (    Integer num : pages_outside_leading_range) {
      html.append("String_Node_Str");
      html.append(url);
      html.append("String_Node_Str" + Integer.toString(num));
      html.append("String_Node_Str" + Integer.toString(pageSize));
      html.append("String_Node_Str");
      html.append(Integer.toString(num));
      html.append("String_Node_Str");
    }
  }
  if (currentPage < totalPages) {
    html.append("String_Node_Str");
    html.append(url);
    html.append("String_Node_Str" + Integer.toString(currentPage + 1));
    html.append("String_Node_Str" + Integer.toString(pageSize));
    html.append("String_Node_Str");
  }
 else {
    html.append("String_Node_Str");
  }
  return html.toString();
}

Fixed version (ground truth):
private String generatePaginator(){
  boolean in_leading_range=false;
  boolean in_trailing_range=false;
  List<Integer> pages_outside_leading_range=new ArrayList<Integer>();
  List<Integer> pages_outside_trailing_range=new ArrayList<Integer>();
  List<Integer> page_numbers;
  if (totalPages <= LEADING_PAGE_RANGE_DISPLAYED) {
    in_leading_range=in_trailing_range=true;
    page_numbers=Functions.range(1,totalPages + 1);
  }
 else   if (currentPage <= LEADING_PAGE_RANGE) {
    in_leading_range=true;
    page_numbers=Functions.range(1,LEADING_PAGE_RANGE_DISPLAYED + 1);
    pages_outside_leading_range=Functions.range(0,-NUM_PAGES_OUTSIDE_RANGE,totalPages);
  }
 else   if (currentPage > totalPages - TRAILING_PAGE_RANGE) {
    in_trailing_range=true;
    page_numbers=Functions.range(totalPages - TRAILING_PAGE_RANGE_DISPLAYED + 1,totalPages + 1);
    pages_outside_trailing_range=Functions.range(0,NUM_PAGES_OUTSIDE_RANGE,1);
  }
 else {
    page_numbers=Functions.range(currentPage - ADJACENT_PAGES,currentPage + ADJACENT_PAGES + 1);
    pages_outside_leading_range=Functions.range(0,-NUM_PAGES_OUTSIDE_RANGE,totalPages);
    pages_outside_trailing_range=Functions.range(0,NUM_PAGES_OUTSIDE_RANGE,1);
  }
  StringBuilder html=new StringBuilder();
  html.append("String_Node_Str");
  String pageUrl=url.contains("String_Node_Str") ? url + "String_Node_Str" : url + "String_Node_Str";
  if (currentPage > 1) {
    html.append("String_Node_Str");
    html.append(pageUrl);
    html.append("String_Node_Str" + Integer.toString(currentPage - 1));
    html.append("String_Node_Str" + Integer.toString(pageSize));
    html.append("String_Node_Str");
  }
 else {
    html.append("String_Node_Str");
  }
  if (!in_leading_range) {
    for (    Integer num : pages_outside_trailing_range) {
      html.append("String_Node_Str");
      html.append(pageUrl);
      html.append("String_Node_Str" + Integer.toString(num));
      html.append("String_Node_Str" + Integer.toString(pageSize));
      html.append("String_Node_Str");
      html.append(Integer.toString(num));
      html.append("String_Node_Str");
    }
    html.append("String_Node_Str");
  }
  if (page_numbers.size() > 0) {
    for (    Integer num : page_numbers) {
      if (num <= totalPages) {
        if (currentPage.equals(num)) {
          html.append("String_Node_Str");
          html.append(Integer.toString(num));
          html.append("String_Node_Str");
        }
 else {
          html.append("String_Node_Str");
          html.append(pageUrl);
          html.append("String_Node_Str" + Integer.toString(num));
          html.append("String_Node_Str" + Integer.toString(pageSize));
          html.append("String_Node_Str");
          html.append(Integer.toString(num));
          html.append("String_Node_Str");
        }
      }
    }
  }
 else {
    html.append("String_Node_Str");
  }
  Collections.reverse(pages_outside_leading_range);
  if (!in_trailing_range) {
    html.append("String_Node_Str");
    for (    Integer num : pages_outside_leading_range) {
      html.append("String_Node_Str");
      html.append(pageUrl);
      html.append("String_Node_Str" + Integer.toString(num));
      html.append("String_Node_Str" + Integer.toString(pageSize));
      html.append("String_Node_Str");
      html.append(Integer.toString(num));
      html.append("String_Node_Str");
    }
  }
  if (currentPage < totalPages) {
    html.append("String_Node_Str");
    html.append(pageUrl);
    html.append("String_Node_Str" + Integer.toString(currentPage + 1));
    html.append("String_Node_Str" + Integer.toString(pageSize));
    html.append("String_Node_Str");
  }
 else {
    html.append("String_Node_Str");
  }
  return html.toString();
}