Program: 74115
Project: 74115
Buggy source:
/** 
 * Test crosstab + table
 * @throws Exception
 */
public void testNestedCrossTab3() throws Exception {
  ICubeQueryDefinition cqd=new CubeQueryDefinition(cubeName);
  IEdgeDefinition columnEdge=cqd.createEdge(ICubeQueryDefinition.COLUMN_EDGE);
  IEdgeDefinition rowEdge=cqd.createEdge(ICubeQueryDefinition.ROW_EDGE);
  IDimensionDefinition dim1=columnEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier1=dim1.createHierarchy("String_Node_Str");
  ILevelDefinition level11=hier1.createLevel("String_Node_Str");
  ILevelDefinition level12=hier1.createLevel("String_Node_Str");
  ILevelDefinition level13=hier1.createLevel("String_Node_Str");
  IDimensionDefinition dim2=rowEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier2=dim2.createHierarchy("String_Node_Str");
  ILevelDefinition level21=hier2.createLevel("String_Node_Str");
  createSortTestBindings(cqd);
  CubeSortDefinition sorter4=new CubeSortDefinition();
  sorter4.setExpression("String_Node_Str");
  sorter4.setAxisQualifierLevels(null);
  sorter4.setAxisQualifierValues(null);
  sorter4.setTargetLevel(level13);
  sorter4.setSortDirection(ISortDefinition.SORT_DESC);
  CubeSortDefinition sorter5=new CubeSortDefinition();
  sorter5.setExpression("String_Node_Str");
  sorter5.setAxisQualifierLevels(null);
  sorter5.setAxisQualifierValues(null);
  sorter5.setTargetLevel(level11);
  sorter5.setSortDirection(ISortDefinition.SORT_DESC);
  cqd.addSort(sorter4);
  cqd.addSort(sorter5);
  DataEngine engine=DataEngine.newDataEngine(DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null));
  this.createCube(engine);
  IPreparedCubeQuery pcq=engine.prepare(cqd,null);
  ICubeQueryResults cqResults=pcq.execute(null);
  CubeCursor outerCursor=cqResults.getCubeCursor();
  this.defineDataSourceDataSet(engine);
  IQueryDefinition query=this.createScriptDataSetQuery();
  query.getFilters().add(new FilterDefinition(new ScriptExpression("String_Node_Str")));
  IPreparedQuery pq=engine.prepare(query);
  int depth=0;
  EdgeCursor edge1=(EdgeCursor)(outerCursor.getOrdinateEdge().get(0));
  EdgeCursor edge2=(EdgeCursor)(outerCursor.getOrdinateEdge().get(1));
  edge1.beforeFirst();
  while (edge2.next()) {
    edge1.beforeFirst();
    while (edge1.next()) {
      depth++;
      this.testPrintln("String_Node_Str" + outerCursor.getObject("String_Node_Str").toString());
      IResultIterator it=((IQueryResults)pq.execute(cqResults,null)).getResultIterator();
      while (it.next()) {
        this.testPrintln("String_Node_Str" + it.getString("String_Node_Str"));
      }
    }
  }
  this.checkOutputFile();
}

Fixed version (ground truth):
/** 
 * Test crosstab + table
 * @throws Exception
 */
public void testNestedCrossTab3() throws Exception {
  ICubeQueryDefinition cqd=new CubeQueryDefinition(cubeName);
  IEdgeDefinition columnEdge=cqd.createEdge(ICubeQueryDefinition.COLUMN_EDGE);
  IEdgeDefinition rowEdge=cqd.createEdge(ICubeQueryDefinition.ROW_EDGE);
  IDimensionDefinition dim1=columnEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier1=dim1.createHierarchy("String_Node_Str");
  ILevelDefinition level11=hier1.createLevel("String_Node_Str");
  ILevelDefinition level12=hier1.createLevel("String_Node_Str");
  ILevelDefinition level13=hier1.createLevel("String_Node_Str");
  IDimensionDefinition dim2=rowEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier2=dim2.createHierarchy("String_Node_Str");
  ILevelDefinition level21=hier2.createLevel("String_Node_Str");
  createSortTestBindings(cqd);
  CubeSortDefinition sorter4=new CubeSortDefinition();
  sorter4.setExpression("String_Node_Str");
  sorter4.setAxisQualifierLevels(null);
  sorter4.setAxisQualifierValues(null);
  sorter4.setTargetLevel(level13);
  sorter4.setSortDirection(ISortDefinition.SORT_DESC);
  CubeSortDefinition sorter5=new CubeSortDefinition();
  sorter5.setExpression("String_Node_Str");
  sorter5.setAxisQualifierLevels(null);
  sorter5.setAxisQualifierValues(null);
  sorter5.setTargetLevel(level11);
  sorter5.setSortDirection(ISortDefinition.SORT_DESC);
  cqd.addSort(sorter4);
  cqd.addSort(sorter5);
  DataEngineImpl engine=(DataEngineImpl)DataEngine.newDataEngine(DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null));
  this.createCube(engine);
  IPreparedCubeQuery pcq=engine.prepare(cqd,null);
  ICubeQueryResults cqResults=pcq.execute(null);
  CubeCursor outerCursor=cqResults.getCubeCursor();
  this.defineDataSourceDataSet(engine);
  IQueryDefinition query=this.createScriptDataSetQuery();
  query.getFilters().add(new FilterDefinition(new ScriptExpression("String_Node_Str")));
  IPreparedQuery pq=engine.prepare(query);
  int depth=0;
  EdgeCursor edge1=(EdgeCursor)(outerCursor.getOrdinateEdge().get(0));
  EdgeCursor edge2=(EdgeCursor)(outerCursor.getOrdinateEdge().get(1));
  edge1.beforeFirst();
  while (edge2.next()) {
    edge1.beforeFirst();
    while (edge1.next()) {
      depth++;
      this.testPrintln("String_Node_Str" + outerCursor.getObject("String_Node_Str").toString());
      IResultIterator it=((IQueryResults)pq.execute(cqResults,null)).getResultIterator();
      while (it.next()) {
        this.testPrintln("String_Node_Str" + it.getString("String_Node_Str"));
      }
    }
  }
  this.checkOutputFile();
}