Program: 67308
Project: 67308
Buggy source:
/** 
 * Parse the dimension levels on row edge and column edge to find out the level index used by category series and Y optional.
 * @param queryDefintion
 * @param cm
 */
private void parseLevelIndex(IBaseCubeQueryDefinition queryDefintion,Chart cm){
  fRowInnerLevelIndex=-1;
  fColInnerLevelIndex=-1;
  if (queryDefintion instanceof ICubeQueryDefinition) {
    List rowLevelNames=Collections.EMPTY_LIST;
    List colLevelNames=Collections.EMPTY_LIST;
    String[] categoryExprs=ChartUtil.getCategoryExpressions(cm);
    ICubeQueryDefinition cqd=(ICubeQueryDefinition)queryDefintion;
    IEdgeDefinition rowED=cqd.getEdge(ICubeQueryDefinition.ROW_EDGE);
    IEdgeDefinition colED=cqd.getEdge(ICubeQueryDefinition.COLUMN_EDGE);
    if (rowED != null) {
      rowLevelNames=getLevelNames(rowED);
      if (categoryExprs != null && categoryExprs.length > 0) {
        fRowInnerLevelIndex=findInnerLevelIndex(categoryExprs[0],rowLevelNames);
        if (fRowInnerLevelIndex < 0 && colED != null) {
          rowLevelNames=getLevelNames(colED);
          fRowInnerLevelIndex=findInnerLevelIndex(categoryExprs[0],rowLevelNames);
          fIsColEdgeAsMainCursor=true;
          return;
        }
      }
    }
    if (colED != null) {
      if (rowED == null && fRowInnerLevelIndex < 0) {
        rowLevelNames=getLevelNames(colED);
        if (categoryExprs != null && categoryExprs.length > 0) {
          fRowInnerLevelIndex=findInnerLevelIndex(categoryExprs[0],rowLevelNames);
          fIsColEdgeAsMainCursor=true;
        }
      }
 else {
        colLevelNames=getLevelNames(colED);
        String[] yOptionalExprs=ChartUtil.getYOptoinalExpressions(cm);
        if (yOptionalExprs != null && yOptionalExprs.length > 0) {
          fColInnerLevelIndex=findInnerLevelIndex(yOptionalExprs[0],colLevelNames);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Parse the dimension levels on row edge and column edge to find out the level index used by category series and Y optional.
 * @param queryDefintion
 * @param cm
 */
private void parseLevelIndex(IBaseCubeQueryDefinition queryDefintion,Chart cm){
  fRowInnerLevelIndex=-1;
  fColInnerLevelIndex=-1;
  if (queryDefintion instanceof ICubeQueryDefinition) {
    List<String> rowLevelNames=Collections.emptyList();
    List<String> colLevelNames=Collections.emptyList();
    String[] categoryExprs=ChartUtil.getCategoryExpressions(cm);
    ICubeQueryDefinition cqd=(ICubeQueryDefinition)queryDefintion;
    IEdgeDefinition rowED=cqd.getEdge(ICubeQueryDefinition.ROW_EDGE);
    IEdgeDefinition colED=cqd.getEdge(ICubeQueryDefinition.COLUMN_EDGE);
    Map<String,String> cubeBindingMap=new HashMap<String,String>();
    List bindingList=cqd.getBindings();
    for (int i=0; i < bindingList.size(); i++) {
      Binding b=(Binding)bindingList.get(i);
      if (b.getExpression() instanceof IScriptExpression) {
        cubeBindingMap.put(b.getBindingName(),((IScriptExpression)b.getExpression()).getText());
      }
    }
    if (rowED != null) {
      rowLevelNames=getLevelNames(rowED);
      if (categoryExprs != null && categoryExprs.length > 0) {
        fRowInnerLevelIndex=findInnerLevelIndex(categoryExprs[0],rowLevelNames,cubeBindingMap);
        if (fRowInnerLevelIndex < 0 && colED != null) {
          rowLevelNames=getLevelNames(colED);
          fRowInnerLevelIndex=findInnerLevelIndex(categoryExprs[0],rowLevelNames,cubeBindingMap);
          fIsColEdgeAsMainCursor=true;
          return;
        }
      }
    }
    if (colED != null) {
      if (rowED == null && fRowInnerLevelIndex < 0) {
        rowLevelNames=getLevelNames(colED);
        if (categoryExprs != null && categoryExprs.length > 0) {
          fRowInnerLevelIndex=findInnerLevelIndex(categoryExprs[0],rowLevelNames,cubeBindingMap);
          fIsColEdgeAsMainCursor=true;
        }
      }
 else {
        colLevelNames=getLevelNames(colED);
        String[] yOptionalExprs=ChartUtil.getYOptoinalExpressions(cm);
        if (yOptionalExprs != null && yOptionalExprs.length > 0) {
          fColInnerLevelIndex=findInnerLevelIndex(yOptionalExprs[0],colLevelNames,cubeBindingMap);
        }
      }
    }
  }
}