Program: 51772
Project: 51772
Buggy source:
/** 
 * Filter out users according to some criteria.
 * @param fieldId - the grade center field to filter on
 * @param op - the operator to apply for the filter
 * @param term - the actual term to use the operator on
 * @return
 * @throws PersistenceException
 * @throws ConnectionNotAvailableException
 */
public LinkedHashSet<UserWrapper> search(ArrayList<SearchCriteria> criterias,String combinationOp) throws PersistenceException, ConnectionNotAvailableException {
  if (criterias.isEmpty()) {
    debug+="String_Node_Str";
    return new LinkedHashSet<UserWrapper>();
  }
  if (criterias.size() == 1) {
    return searchSingleCriteria(criterias.get(0));
  }
  if (combinationOp.equals("String_Node_Str")) {
    LinkedHashSet<UserWrapper> ret=new LinkedHashSet<UserWrapper>();
    for (    SearchCriteria criteria : criterias) {
      LinkedHashSet<UserWrapper> searchRes=searchSingleCriteria(criteria);
      ret.addAll(searchRes);
    }
    createSearchFields(ret,criterias);
    return ret;
  }
 else   if (combinationOp.equals("String_Node_Str")) {
    LinkedHashSet<UserWrapper> ret=searchSingleCriteria(criterias.remove(0));
    for (    SearchCriteria criteria : criterias) {
      LinkedHashSet<UserWrapper> searchRes=searchSingleCriteria(criteria);
      ret.retainAll(searchRes);
    }
    createSearchFields(ret,criterias);
    return ret;
  }
  debug+="String_Node_Str" + combinationOp + "String_Node_Str";
  return new LinkedHashSet<UserWrapper>();
}

Fixed version (ground truth):
/** 
 * Filter out users according to some criteria.
 * @param fieldId - the grade center field to filter on
 * @param op - the operator to apply for the filter
 * @param term - the actual term to use the operator on
 * @return
 * @throws PersistenceException
 * @throws ConnectionNotAvailableException
 */
public LinkedHashSet<UserWrapper> search(ArrayList<SearchCriteria> criterias,String combinationOp) throws PersistenceException, ConnectionNotAvailableException {
  if (criterias.isEmpty()) {
    debug+="String_Node_Str";
    return new LinkedHashSet<UserWrapper>();
  }
  if (criterias.size() == 1) {
    debug+="String_Node_Str";
    LinkedHashSet<UserWrapper> ret=searchSingleCriteria(criterias.get(0));
    createSearchFields(ret,criterias);
    return ret;
  }
  debug+="String_Node_Str";
  debug+="String_Node_Str" + criterias.size();
  if (combinationOp.equals("String_Node_Str")) {
    LinkedHashSet<UserWrapper> ret=new LinkedHashSet<UserWrapper>();
    for (    SearchCriteria criteria : criterias) {
      LinkedHashSet<UserWrapper> searchRes=searchSingleCriteria(criteria);
      ret.addAll(searchRes);
    }
    createSearchFields(ret,criterias);
    return ret;
  }
 else   if (combinationOp.equals("String_Node_Str")) {
    LinkedHashSet<UserWrapper> ret=null;
    debug+="String_Node_Str" + criterias.size();
    for (    SearchCriteria criteria : criterias) {
      if (ret == null) {
        ret=searchSingleCriteria(criteria);
        continue;
      }
      LinkedHashSet<UserWrapper> searchRes=searchSingleCriteria(criteria);
      ret.retainAll(searchRes);
    }
    debug+="String_Node_Str" + criterias.size();
    createSearchFields(ret,criterias);
    return ret;
  }
  debug+="String_Node_Str" + combinationOp + "String_Node_Str";
  return new LinkedHashSet<UserWrapper>();
}