Program: 67095
Project: 67095
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<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);
        }
      }
    }
  }
}

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){
  fCategoryInnerLevelIndex=-1;
  fYOptionalInnerLevelIndex=-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 (categoryExprs != null && categoryExprs.length > 0) {
      if (rowED != null) {
        rowLevelNames=getLevelNames(rowED);
        fCategoryInnerLevelIndex=findInnerLevelIndex(categoryExprs[0],rowLevelNames,cubeBindingMap);
      }
      if (fCategoryInnerLevelIndex < 0 && colED != null) {
        rowLevelNames=getLevelNames(colED);
        fCategoryInnerLevelIndex=findInnerLevelIndex(categoryExprs[0],rowLevelNames,cubeBindingMap);
        fIsColEdgeAsCategoryCursor=true;
      }
    }
    if (fCategoryInnerLevelIndex < 0) {
      return;
    }
    String[] yOptionalExprs=ChartUtil.getYOptoinalExpressions(cm);
    if (yOptionalExprs != null && yOptionalExprs.length > 0) {
      if (fIsColEdgeAsCategoryCursor && rowED != null) {
        colLevelNames=getLevelNames(rowED);
        fYOptionalInnerLevelIndex=findInnerLevelIndex(yOptionalExprs[0],colLevelNames,cubeBindingMap);
      }
 else       if (colED != null) {
        colLevelNames=getLevelNames(colED);
        fYOptionalInnerLevelIndex=findInnerLevelIndex(yOptionalExprs[0],colLevelNames,cubeBindingMap);
      }
    }
  }
}