Program: 75724
Project: 75724
Buggy source:
/** 
 * @param cubeQueryDefinition
 * @param cubeQueryExcutorHelper
 * @throws DataException
 */
private void populateAggregationSort(CubeQueryExecutor executor,CubeQueryExecutorHelper cubeQueryExcutorHelper,boolean isRow) throws DataException {
  List columnSort=isRow ? executor.getRowEdgeSort() : executor.getColumnEdgeSort();
  for (int i=0; i < columnSort.size(); i++) {
    ICubeSortDefinition cubeSort=(ICubeSortDefinition)columnSort.get(i);
    String bindingName=OlapExpressionUtil.getBindingName(cubeSort.getExpression().getText());
    if (bindingName == null)     continue;
    List bindings=executor.getCubeQueryDefinition().getBindings();
    List aggrOns=null;
    for (int j=0; j < bindings.size(); j++) {
      IBinding binding=(IBinding)bindings.get(j);
      if (binding.getBindingName().equals(bindingName)) {
        aggrOns=binding.getAggregatOns();
        break;
      }
    }
    if (aggrOns == null)     throw new DataException("String_Node_Str");
    DimLevel[] aggrOnLevels=new DimLevel[aggrOns.size()];
    for (int j=0; j < aggrOnLevels.length; j++) {
      aggrOnLevels[j]=OlapExpressionUtil.getTargetDimLevel(aggrOns.get(j).toString());
    }
    DimLevel[] axisLevels=new DimLevel[cubeSort.getAxisQualifierLevel().length];
    for (int k=0; k < axisLevels.length; k++) {
      axisLevels[k]=new DimLevel(cubeSort.getAxisQualifierLevel()[k]);
    }
    AggrSortDefinition sort=new AggrSortDefinition(aggrOnLevels,bindingName,axisLevels,cubeSort.getAxisQualifierValue(),new DimLevel(cubeSort.getTargetLevel()),cubeSort.getSortDirection() == 1 ? false : true);
    if (isRow)     cubeQueryExcutorHelper.addRowSort(sort);
 else     cubeQueryExcutorHelper.addColumnSort(sort);
  }
}

Fixed version (ground truth):
/** 
 * @param cubeQueryDefinition
 * @param cubeQueryExcutorHelper
 * @throws DataException
 */
private void populateAggregationSort(CubeQueryExecutor executor,CubeQueryExecutorHelper cubeQueryExcutorHelper,boolean isRow) throws DataException {
  List columnSort=isRow ? executor.getRowEdgeSort() : executor.getColumnEdgeSort();
  for (int i=0; i < columnSort.size(); i++) {
    ICubeSortDefinition cubeSort=(ICubeSortDefinition)columnSort.get(i);
    String bindingName=OlapExpressionUtil.getBindingName(cubeSort.getExpression().getText());
    if (bindingName == null)     continue;
    List bindings=executor.getCubeQueryDefinition().getBindings();
    List aggrOns=null;
    for (int j=0; j < bindings.size(); j++) {
      IBinding binding=(IBinding)bindings.get(j);
      if (binding.getBindingName().equals(bindingName)) {
        aggrOns=binding.getAggregatOns();
        break;
      }
    }
    if (aggrOns == null || aggrOns.size() == 0)     return;
    DimLevel[] aggrOnLevels=new DimLevel[aggrOns.size()];
    for (int j=0; j < aggrOnLevels.length; j++) {
      aggrOnLevels[j]=OlapExpressionUtil.getTargetDimLevel(aggrOns.get(j).toString());
    }
    DimLevel[] axisLevels=new DimLevel[cubeSort.getAxisQualifierLevel().length];
    for (int k=0; k < axisLevels.length; k++) {
      axisLevels[k]=new DimLevel(cubeSort.getAxisQualifierLevel()[k]);
    }
    AggrSortDefinition sort=new AggrSortDefinition(aggrOnLevels,bindingName,axisLevels,cubeSort.getAxisQualifierValue(),new DimLevel(cubeSort.getTargetLevel()),cubeSort.getSortDirection() == 1 ? false : true);
    if (isRow)     cubeQueryExcutorHelper.addRowSort(sort);
 else     cubeQueryExcutorHelper.addColumnSort(sort);
  }
}