Program: 75874
Project: 75874
Buggy source:
public Collection getSelectionList(String name){
  usingParameterValues();
  ReportDesignHandle report=(ReportDesignHandle)this.runnable.getDesignHandle();
  ScalarParameterHandle parameter=(ScalarParameterHandle)report.findParameter(name);
  if (parameter == null) {
    return Collections.EMPTY_LIST;
  }
  String selectionType=parameter.getValueType();
  String dataType=parameter.getDataType();
  boolean fixedOrder=parameter.isFixedOrder();
  if (DesignChoiceConstants.PARAM_VALUE_TYPE_DYNAMIC.equals(selectionType)) {
    CascadingParameterGroupHandle group=null;
    if (isCascadingParameter(parameter)) {
      group=getCascadingGroup(parameter);
    }
    if (group != null && DesignChoiceConstants.DATA_SET_MODE_SINGLE.equals(group.getDataSetMode())) {
      return getCascadingParameterList(parameter);
    }
 else     if (parameter.getDataSetName() != null) {
      return getChoicesFromParameterQuery(parameter);
    }
 else     if (group != null) {
      return getCascadingParameterList(parameter);
    }
  }
 else   if (DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC.equals(selectionType)) {
    Iterator iter=parameter.choiceIterator();
    ArrayList choices=new ArrayList();
    while (iter.hasNext()) {
      SelectionChoiceHandle choice=(SelectionChoiceHandle)iter.next();
      String label=report.getMessage(choice.getLabelKey(),locale);
      if (label == null) {
        label=choice.getLabel();
      }
      Object value=getStringValue(choice.getValue(),dataType);
      choices.add(new SelectionChoice(label,value));
    }
    if (!fixedOrder)     Collections.sort(choices,new SelectionChoiceComparator(true,parameter.getPattern(),ULocale.forLocale(locale)));
    return choices;
  }
  return Collections.EMPTY_LIST;
}

Fixed version (ground truth):
public Collection getSelectionList(String name){
  usingParameterValues();
  ReportDesignHandle report=(ReportDesignHandle)this.runnable.getDesignHandle();
  ScalarParameterHandle parameter=(ScalarParameterHandle)report.findParameter(name);
  if (parameter == null) {
    return Collections.EMPTY_LIST;
  }
  String selectionType=parameter.getValueType();
  String dataType=parameter.getDataType();
  boolean fixedOrder=parameter.isFixedOrder();
  boolean sortByLabel="String_Node_Str".equalsIgnoreCase(parameter.getSortBy());
  boolean sortDirectionValue="String_Node_Str".equalsIgnoreCase(parameter.getSortDirection());
  if (DesignChoiceConstants.PARAM_VALUE_TYPE_DYNAMIC.equals(selectionType)) {
    CascadingParameterGroupHandle group=null;
    if (isCascadingParameter(parameter)) {
      group=getCascadingGroup(parameter);
    }
    if (group != null && DesignChoiceConstants.DATA_SET_MODE_SINGLE.equals(group.getDataSetMode())) {
      return getCascadingParameterList(parameter);
    }
 else     if (parameter.getDataSetName() != null) {
      return getChoicesFromParameterQuery(parameter);
    }
 else     if (group != null) {
      return getCascadingParameterList(parameter);
    }
  }
 else   if (DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC.equals(selectionType)) {
    Iterator iter=parameter.choiceIterator();
    ArrayList choices=new ArrayList();
    while (iter.hasNext()) {
      SelectionChoiceHandle choice=(SelectionChoiceHandle)iter.next();
      String label=report.getMessage(choice.getLabelKey(),locale);
      if (label == null) {
        label=choice.getLabel();
      }
      Object value=getStringValue(choice.getValue(),dataType);
      choices.add(new SelectionChoice(label,value));
    }
    if (!fixedOrder)     Collections.sort(choices,new SelectionChoiceComparator(sortByLabel,parameter.getPattern(),sortDirectionValue,ULocale.forLocale(locale)));
    return choices;
  }
  return Collections.EMPTY_LIST;
}