Program: 189376
Project: 189376
Buggy source:
/** 
 * Customize the columns shown, and their order, and the results per page.
 * @param nav list or log
 */
@Security(RoleType.REVIEWER) public static void customizeSearch(String nav){
  int type=SUBMISSION;
  if ("String_Node_Str".equals(nav))   type=ACTION_LOG;
  List<SearchOrder> columns=new ArrayList<SearchOrder>();
  String columnsString=params.get("String_Node_Str");
  String[] columnIds=columnsString.split("String_Node_Str");
  for (  String columnId : columnIds) {
    String[] parts=columnId.split("String_Node_Str");
    SearchOrder column=SearchOrder.find(Integer.valueOf(parts[1]));
    columns.add(column);
  }
  if (columns.contains(SearchOrder.ID)) {
    String columnsSerialized="String_Node_Str";
    for (    SearchOrder column : columns) {
      if (columnsSerialized.length() > 0)       columnsSerialized+="String_Node_Str";
      columnsSerialized+=column.getId();
    }
    ActiveSearchFilter activeFilter=getActiveSearchFilter(type);
    activeFilter.setColumns(columns);
    response.setCookie(NAMES[type][ACTIVE_FILTER],activeFilter.encode(),COOKIE_DURATION);
  }
  Integer resultsPerPage=params.get("String_Node_Str",Integer.class);
  if (resultsPerPage != null && resultsPerPage > 0 && resultsPerPage <= 1000) {
    response.setCookie(NAMES[type][RESULTSPERPAGE],String.valueOf(resultsPerPage),COOKIE_DURATION);
    session.remove(NAMES[type][OFFSET]);
  }
  if ("String_Node_Str".equals(nav))   list();
  if ("String_Node_Str".equals(nav))   log();
  error("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Customize the columns shown, and their order, and the results per page.
 * @param nav list or log
 */
@Security(RoleType.REVIEWER) public static void customizeSearch(String nav){
  int type=SUBMISSION;
  if ("String_Node_Str".equals(nav))   type=ACTION_LOG;
  boolean set_default_columns=(params.get("String_Node_Str") != null);
  List<SearchOrder> columns=getDefaultColumns(type);
  if (!set_default_columns) {
    String columnsString=params.get("String_Node_Str");
    String[] columnIds=columnsString.split("String_Node_Str");
    for (    String columnId : columnIds) {
      String[] parts=columnId.split("String_Node_Str");
      SearchOrder column=SearchOrder.find(Integer.valueOf(parts[1]));
      columns.add(column);
    }
  }
  if (columns.contains(SearchOrder.ID)) {
    String columnsSerialized="String_Node_Str";
    for (    SearchOrder column : columns) {
      if (columnsSerialized.length() > 0)       columnsSerialized+="String_Node_Str";
      columnsSerialized+=column.getId();
    }
    ActiveSearchFilter activeFilter=getActiveSearchFilter(type);
    activeFilter.setColumns(columns);
    response.setCookie(NAMES[type][ACTIVE_FILTER],activeFilter.encode(),COOKIE_DURATION);
  }
  Integer resultsPerPage=params.get("String_Node_Str",Integer.class);
  if (resultsPerPage != null && resultsPerPage > 0 && resultsPerPage <= 1000) {
    response.setCookie(NAMES[type][RESULTSPERPAGE],String.valueOf(resultsPerPage),COOKIE_DURATION);
    session.remove(NAMES[type][OFFSET]);
  }
  if ("String_Node_Str".equals(nav))   list();
  if ("String_Node_Str".equals(nav))   log();
  error("String_Node_Str");
}