Program: 188297
Project: 188297
Buggy source:
public FilterParameter getFilter(){
  FilterParameter filterParameter=null;
  String type=searchField.getType();
  List<String> searchFields=searchField.getSearchFields();
  if (searchFields != null && !searchFields.isEmpty()) {
    String field=searchFields.get(0);
    if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_DATE) && dateValid(inputDateBox)) {
      filterParameter=new SimpleFilterParameter(field,inputDateBox.getValue().toString());
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_DATE_INTERVAL) && dateIntervalValid(inputDateBoxFrom,inputDateBoxTo) && searchFields.size() >= 2) {
      String fieldTo=searchField.getSearchFields().get(1);
      filterParameter=new DateIntervalFilterParameter(field,fieldTo,inputDateBoxFrom.getValue(),inputDateBoxTo.getValue());
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_DATE_INTERVAL) && dateIntervalValid(inputDateBoxFrom,inputDateBoxTo)) {
      filterParameter=new DateIntervalFilterParameter(field,field,inputDateBoxFrom.getValue(),inputDateBoxTo.getValue());
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_NUMERIC) && valid(inputNumeric)) {
      filterParameter=new BasicSearchFilterParameter(field,inputNumeric.getValue());
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_NUMERIC_INTERVAL) && intervalValid(inputNumericFrom,inputNumericTo)) {
      filterParameter=new LongRangeFilterParameter(field,Long.valueOf(inputNumericFrom.getValue()),Long.valueOf(inputNumericTo.getValue()));
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_STORAGE) && intervalValid(inputStorageSizeFrom,inputStorageSizeTo)) {
      filterParameter=new LongRangeFilterParameter(field,Humanize.parseFileSize(inputStorageSizeFrom.getValue(),inputStorageSizeList.getSelectedValue()),Humanize.parseFileSize(inputStorageSizeTo.getValue(),inputStorageSizeList.getSelectedValue()));
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_BOOLEAN) && valid(inputCheckBox)) {
      filterParameter=new SimpleFilterParameter(field,Boolean.toString(inputCheckBox.getValue()));
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_SUGGEST) && valid(inputSearchSuggestBox)) {
      filterParameter=new SimpleFilterParameter(inputSearchSuggestBox.isAllowPartial() ? field + RodaConstants.INDEX_SEARCH_SUFFIX : field,inputSearchSuggestBox.getValue());
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_CONTROLLED)) {
      filterParameter=new SimpleFilterParameter(field,inputControlled.getSelectedValue());
    }
 else     if (valid(inputText)) {
      filterParameter=new BasicSearchFilterParameter(field,inputText.getValue());
    }
  }
  return filterParameter;
}

Fixed version (ground truth):
public FilterParameter getFilter(){
  FilterParameter filterParameter=null;
  String type=searchField.getType();
  List<String> searchFields=searchField.getSearchFields();
  if (searchFields != null && !searchFields.isEmpty()) {
    String field=searchFields.get(0);
    if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_DATE) && dateValid(inputDateBox)) {
      filterParameter=new SimpleFilterParameter(field,inputDateBox.getValue().toString());
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_DATE_INTERVAL) && dateIntervalValid(inputDateBoxFrom,inputDateBoxTo) && searchFields.size() >= 2) {
      String fieldTo=searchField.getSearchFields().get(1);
      filterParameter=new DateIntervalFilterParameter(field,fieldTo,inputDateBoxFrom.getValue(),inputDateBoxTo.getValue());
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_DATE_INTERVAL) && dateIntervalValid(inputDateBoxFrom,inputDateBoxTo)) {
      filterParameter=new DateIntervalFilterParameter(field,field,inputDateBoxFrom.getValue(),inputDateBoxTo.getValue());
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_NUMERIC) && valid(inputNumeric)) {
      filterParameter=new BasicSearchFilterParameter(field,inputNumeric.getValue());
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_NUMERIC_INTERVAL) && intervalValid(inputNumericFrom,inputNumericTo)) {
      filterParameter=new LongRangeFilterParameter(field,inputNumericFrom.getValue(),inputNumericTo.getValue());
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_STORAGE) && intervalValid(inputStorageSizeFrom,inputStorageSizeTo)) {
      filterParameter=new LongRangeFilterParameter(field,Humanize.parseFileSize(inputStorageSizeFrom.getValue(),inputStorageSizeList.getSelectedValue()),Humanize.parseFileSize(inputStorageSizeTo.getValue(),inputStorageSizeList.getSelectedValue()));
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_BOOLEAN) && valid(inputCheckBox)) {
      filterParameter=new SimpleFilterParameter(field,Boolean.toString(inputCheckBox.getValue()));
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_SUGGEST) && valid(inputSearchSuggestBox)) {
      filterParameter=new SimpleFilterParameter(inputSearchSuggestBox.isAllowPartial() ? field + RodaConstants.INDEX_SEARCH_SUFFIX : field,inputSearchSuggestBox.getValue());
    }
 else     if (type.equals(RodaConstants.SEARCH_FIELD_TYPE_CONTROLLED)) {
      filterParameter=new SimpleFilterParameter(field,inputControlled.getSelectedValue());
    }
 else     if (valid(inputText)) {
      filterParameter=new BasicSearchFilterParameter(field,inputText.getValue());
    }
  }
  return filterParameter;
}