Program: 67376
Project: 67376
Buggy source:
private void initMeasureNavigator(){
  IEdgeAxis[] edgeAxises=this.resultSet.getMeasureResult();
  int measureMaxSize=0;
  for (int i=0; i < edgeAxises.length; i++) {
    if (edgeAxises[i].getQueryResultSet().getAllLevels() != null && edgeAxises[i].getQueryResultSet().getAllLevels().length > measureMaxSize) {
      maxAggregationResultSet=edgeAxises[i].getQueryResultSet();
      measureMaxSize=edgeAxises[i].getQueryResultSet().getAllLevels().length;
    }
  }
  Iterator iterator=relationMap.values().iterator();
  int relationMaxLevelSize=0;
  maxRelationship=new Relationship(new ArrayList(),new ArrayList(),new ArrayList());
  while (iterator.hasNext()) {
    Relationship relation=(Relationship)iterator.next();
    int levelSize=relation.getLevelListOnColumn().size() + relation.getLevelListOnPage().size() + relation.getLevelListOnRow().size();
    if (levelSize > relationMaxLevelSize) {
      relationMaxLevelSize=levelSize;
      maxRelationship=relation;
    }
  }
  if (this.view.getRowEdgeView() != null) {
    rowEdgeCursor=(EdgeCursor)((BirtEdgeView)this.view.getRowEdgeView()).getEdgeCursor();
  }
  if (this.view.getColumnEdgeView() != null) {
    columnEdgeCursor=(EdgeCursor)((BirtEdgeView)this.view.getColumnEdgeView()).getEdgeCursor();
  }
  if (this.view.getPageEdgeView() != null) {
    pageEdgeCursor=(EdgeCursor)((BirtEdgeView)this.view.getPageEdgeView()).getEdgeCursor();
  }
  DimLevel[] measureLevels=new DimLevel[0];
  if (maxAggregationResultSet != null) {
    measureLevels=maxAggregationResultSet.getAllLevels();
  }
  rowLevelIndexs=new int[maxRelationship.getLevelListOnRow().size()];
  for (int i=0; i < rowLevelIndexs.length; i++) {
    DimLevel level=(DimLevel)maxRelationship.getLevelListOnRow().get(i);
    for (int j=0; j < measureLevels.length; j++) {
      if (level.equals(measureLevels[j]))       rowLevelIndexs[i]=j;
    }
  }
  columnLevelIndexs=new int[maxRelationship.getLevelListOnColumn().size()];
  for (int i=0; i < columnLevelIndexs.length; i++) {
    DimLevel level=(DimLevel)maxRelationship.getLevelListOnColumn().get(i);
    for (int j=0; j < measureLevels.length; j++) {
      if (level.equals(measureLevels[j]))       columnLevelIndexs[i]=j;
    }
  }
  pageLevelIndexs=new int[maxRelationship.getLevelListOnPage().size()];
  for (int i=0; i < pageLevelIndexs.length; i++) {
    DimLevel level=(DimLevel)maxRelationship.getLevelListOnPage().get(i);
    for (int j=0; j < measureLevels.length; j++) {
      if (level.equals(measureLevels[j]))       pageLevelIndexs[i]=j;
    }
  }
}

Fixed version (ground truth):
private void initMeasureNavigator(){
  IEdgeAxis[] edgeAxises=this.resultSet.getMeasureResult();
  int measureMaxSize=0;
  for (int i=0; i < edgeAxises.length; i++) {
    if (edgeAxises[i].getQueryResultSet().getAllLevels() != null && edgeAxises[i].getQueryResultSet().getAllLevels().length > measureMaxSize) {
      maxAggregationResultSet=edgeAxises[i].getQueryResultSet();
      measureMaxSize=edgeAxises[i].getQueryResultSet().getAllLevels().length;
    }
  }
  Iterator iterator=relationMap.values().iterator();
  int relationMaxLevelSize=0;
  maxRelationship=new Relationship(new ArrayList(),new ArrayList(),new ArrayList());
  while (iterator.hasNext()) {
    Relationship relation=(Relationship)iterator.next();
    int levelSize=relation.getLevelListOnColumn().size() + relation.getLevelListOnPage().size() + relation.getLevelListOnRow().size();
    if (levelSize > relationMaxLevelSize) {
      relationMaxLevelSize=levelSize;
      maxRelationship=relation;
    }
  }
  DimLevel[] measureLevels=new DimLevel[0];
  if (maxAggregationResultSet != null) {
    measureLevels=maxAggregationResultSet.getAllLevels();
  }
  rowLevelIndexs=new int[maxRelationship.getLevelListOnRow().size()];
  for (int i=0; i < rowLevelIndexs.length; i++) {
    DimLevel level=(DimLevel)maxRelationship.getLevelListOnRow().get(i);
    for (int j=0; j < measureLevels.length; j++) {
      if (level.equals(measureLevels[j]))       rowLevelIndexs[i]=j;
    }
  }
  columnLevelIndexs=new int[maxRelationship.getLevelListOnColumn().size()];
  for (int i=0; i < columnLevelIndexs.length; i++) {
    DimLevel level=(DimLevel)maxRelationship.getLevelListOnColumn().get(i);
    for (int j=0; j < measureLevels.length; j++) {
      if (level.equals(measureLevels[j]))       columnLevelIndexs[i]=j;
    }
  }
  pageLevelIndexs=new int[maxRelationship.getLevelListOnPage().size()];
  for (int i=0; i < pageLevelIndexs.length; i++) {
    DimLevel level=(DimLevel)maxRelationship.getLevelListOnPage().get(i);
    for (int j=0; j < measureLevels.length; j++) {
      if (level.equals(measureLevels[j]))       pageLevelIndexs[i]=j;
    }
  }
}