Program: 76405
Project: 76405
Buggy source:
/** 
 * @throws OLAPException
 * @throws BirtException 
 */
public void testCursorModel1() throws OLAPException, BirtException {
  ICubeQueryDefinition cqd=new CubeQueryDefinition("String_Node_Str");
  cqd.createMeasure("String_Node_Str");
  cqd.createMeasure("String_Node_Str");
  IEdgeDefinition columnEdge=cqd.createEdge(ICubeQueryDefinition.ROW_EDGE);
  IDimensionDefinition timeDim=columnEdge.createDimension("String_Node_Str");
  IHierarchyDefinition timeHier=timeDim.createHierarchy("String_Node_Str");
  timeHier.createLevel("String_Node_Str");
  IEdgeDefinition rowEdge=cqd.createEdge(ICubeQueryDefinition.COLUMN_EDGE);
  IDimensionDefinition geographyDim=rowEdge.createDimension("String_Node_Str");
  IHierarchyDefinition geographyHier=geographyDim.createHierarchy("String_Node_Str");
  geographyHier.createLevel("String_Node_Str");
  geographyHier.createLevel("String_Node_Str");
  geographyHier.createLevel("String_Node_Str");
  IBinding rowGrandTotal=new Binding("String_Node_Str");
  rowGrandTotal.setAggrFunction(BuiltInAggregationFactory.TOTAL_SUM_FUNC);
  rowGrandTotal.setExpression(new ScriptExpression("String_Node_Str"));
  rowGrandTotal.addAggregateOn("String_Node_Str");
  IBinding columnGrandTotal=new Binding("String_Node_Str");
  columnGrandTotal.setAggrFunction(BuiltInAggregationFactory.TOTAL_SUM_FUNC);
  columnGrandTotal.setExpression(new ScriptExpression("String_Node_Str"));
  columnGrandTotal.addAggregateOn("String_Node_Str");
  columnGrandTotal.addAggregateOn("String_Node_Str");
  columnGrandTotal.addAggregateOn("String_Node_Str");
  cqd.addBinding(rowGrandTotal);
  cqd.addBinding(columnGrandTotal);
  BirtCubeView cubeView=new BirtCubeView(new CubeQueryExecutor(cqd,this.scope,DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,scope,null,null)));
  CubeCursor dataCursor=cubeView.getCubeCursor();
  EdgeCursor rowCursor=cubeView.getRowEdgeView().getEdgeCursor();
  EdgeCursor columnCursor=cubeView.getColumnEdgeView().getEdgeCursor();
  DimensionCursor countryCursor=(DimensionCursor)columnCursor.getDimensionCursor().get(0);
  DimensionCursor cityCursor=(DimensionCursor)columnCursor.getDimensionCursor().get(1);
  DimensionCursor productCursor=(DimensionCursor)columnCursor.getDimensionCursor().get(2);
  DimensionCursor timeCursor=(DimensionCursor)rowCursor.getDimensionCursor().get(0);
  columnCursor.beforeFirst();
  Object obj1, obj2, obj3;
  while (columnCursor.next()) {
    obj1=countryCursor.getObject("String_Node_Str");
    print(obj1);
    obj2=cityCursor.getObject("String_Node_Str");
    print(obj2);
    obj3=productCursor.getObject("String_Node_Str");
    print(obj3);
  }
  rowCursor.beforeFirst();
  while (rowCursor.next()) {
    print(timeCursor.getObject("String_Node_Str"));
    columnCursor.beforeFirst();
    while (columnCursor.next()) {
      print(dataCursor.getObject("String_Node_Str"));
      print(dataCursor.getObject("String_Node_Str"));
    }
  }
  System.out.println("String_Node_Str");
  countryCursor.beforeFirst();
  while (countryCursor.next()) {
    cityCursor.beforeFirst();
    while (cityCursor.next()) {
      productCursor.beforeFirst();
      while (productCursor.next()) {
        print(countryCursor.getObject("String_Node_Str"));
        print(cityCursor.getObject("String_Node_Str"));
        print(productCursor.getObject("String_Node_Str"));
      }
    }
  }
  timeCursor.beforeFirst();
  while (timeCursor.next()) {
    print(timeCursor.getString(0));
    countryCursor.beforeFirst();
    while (countryCursor.next()) {
      cityCursor.beforeFirst();
      while (cityCursor.next()) {
        productCursor.beforeFirst();
        while (productCursor.next()) {
          print(dataCursor.getObject(0));
          print(dataCursor.getObject(1));
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @throws OLAPException
 * @throws BirtException 
 */
public void testCursorModel1() throws OLAPException, BirtException {
  ICubeQueryDefinition cqd=new CubeQueryDefinition(CubeCreator.cubeName);
  cqd.createMeasure("String_Node_Str");
  cqd.createMeasure("String_Node_Str");
  IEdgeDefinition columnEdge=cqd.createEdge(ICubeQueryDefinition.ROW_EDGE);
  IDimensionDefinition timeDim=columnEdge.createDimension("String_Node_Str");
  IHierarchyDefinition timeHier=timeDim.createHierarchy("String_Node_Str");
  timeHier.createLevel("String_Node_Str");
  IEdgeDefinition rowEdge=cqd.createEdge(ICubeQueryDefinition.COLUMN_EDGE);
  IDimensionDefinition geographyDim=rowEdge.createDimension("String_Node_Str");
  IHierarchyDefinition geographyHier=geographyDim.createHierarchy("String_Node_Str");
  geographyHier.createLevel("String_Node_Str");
  geographyHier.createLevel("String_Node_Str");
  geographyHier.createLevel("String_Node_Str");
  IBinding rowGrandTotal=new Binding("String_Node_Str");
  rowGrandTotal.setAggrFunction(BuiltInAggregationFactory.TOTAL_SUM_FUNC);
  rowGrandTotal.setExpression(new ScriptExpression("String_Node_Str"));
  rowGrandTotal.addAggregateOn("String_Node_Str");
  IBinding columnGrandTotal=new Binding("String_Node_Str");
  columnGrandTotal.setAggrFunction(BuiltInAggregationFactory.TOTAL_SUM_FUNC);
  columnGrandTotal.setExpression(new ScriptExpression("String_Node_Str"));
  columnGrandTotal.addAggregateOn("String_Node_Str");
  columnGrandTotal.addAggregateOn("String_Node_Str");
  columnGrandTotal.addAggregateOn("String_Node_Str");
  cqd.addBinding(rowGrandTotal);
  cqd.addBinding(columnGrandTotal);
  BirtCubeView cubeView=new BirtCubeView(new CubeQueryExecutor(cqd,this.scope,DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,scope,null,null)));
  CubeCursor dataCursor=cubeView.getCubeCursor();
  EdgeCursor rowCursor=cubeView.getRowEdgeView().getEdgeCursor();
  EdgeCursor columnCursor=cubeView.getColumnEdgeView().getEdgeCursor();
  DimensionCursor countryCursor=(DimensionCursor)columnCursor.getDimensionCursor().get(0);
  DimensionCursor cityCursor=(DimensionCursor)columnCursor.getDimensionCursor().get(1);
  DimensionCursor productCursor=(DimensionCursor)columnCursor.getDimensionCursor().get(2);
  DimensionCursor timeCursor=(DimensionCursor)rowCursor.getDimensionCursor().get(0);
  columnCursor.beforeFirst();
  Object obj1, obj2, obj3;
  while (columnCursor.next()) {
    obj1=countryCursor.getObject("String_Node_Str");
    print(obj1);
    obj2=cityCursor.getObject("String_Node_Str");
    print(obj2);
    obj3=productCursor.getObject("String_Node_Str");
    print(obj3);
  }
  rowCursor.beforeFirst();
  while (rowCursor.next()) {
    print(timeCursor.getObject("String_Node_Str"));
    columnCursor.beforeFirst();
    while (columnCursor.next()) {
      print(dataCursor.getObject("String_Node_Str"));
      print(dataCursor.getObject("String_Node_Str"));
    }
  }
  System.out.println("String_Node_Str");
  countryCursor.beforeFirst();
  while (countryCursor.next()) {
    cityCursor.beforeFirst();
    while (cityCursor.next()) {
      productCursor.beforeFirst();
      while (productCursor.next()) {
        print(countryCursor.getObject("String_Node_Str"));
        print(cityCursor.getObject("String_Node_Str"));
        print(productCursor.getObject("String_Node_Str"));
      }
    }
  }
  timeCursor.beforeFirst();
  while (timeCursor.next()) {
    print(timeCursor.getString(0));
    countryCursor.beforeFirst();
    while (countryCursor.next()) {
      cityCursor.beforeFirst();
      while (cityCursor.next()) {
        productCursor.beforeFirst();
        while (productCursor.next()) {
          print(dataCursor.getObject(0));
          print(dataCursor.getObject(1));
        }
      }
    }
  }
}