Program: 74116
Project: 74116
Buggy source:
/** 
 * Test Table + crosstab
 * @throws Exception
 */
public void testNestedCrossTab1() 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);
  CubeFilterDefinition filter1=new CubeFilterDefinition(new ScriptExpression("String_Node_Str"));
  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.addFilter(filter1);
  cqd.addSort(sorter4);
  cqd.addSort(sorter5);
  DataEngine engine=DataEngine.newDataEngine(DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null));
  this.createCube(engine);
  this.defineDataSourceDataSet(engine);
  IQueryDefinition query=this.createScriptDataSetQuery();
  IPreparedQuery pq=engine.prepare(query);
  IQueryResults queryResults=pq.execute(null);
  IResultIterator it=queryResults.getResultIterator();
  while (it.next()) {
    if ("String_Node_Str".equals(it.getValue("String_Node_Str").toString()) || "String_Node_Str".equals(it.getValue("String_Node_Str").toString())) {
      this.testPrintln("String_Node_Str" + it.getValue("String_Node_Str").toString());
      IPreparedCubeQuery pcq=engine.prepare(cqd,null);
      ICubeQueryResults cqResults=(ICubeQueryResults)pcq.execute(queryResults,null);
      CubeCursor cursor=cqResults.getCubeCursor();
      List columnEdgeBindingNames=new ArrayList();
      columnEdgeBindingNames.add("String_Node_Str");
      columnEdgeBindingNames.add("String_Node_Str");
      columnEdgeBindingNames.add("String_Node_Str");
      printCube(cursor,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},"String_Node_Str","String_Node_Str",false);
    }
  }
  this.checkOutputFile();
}

Fixed version (ground truth):
/** 
 * Test Table + crosstab
 * @throws Exception
 */
public void testNestedCrossTab1() 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);
  CubeFilterDefinition filter1=new CubeFilterDefinition(new ScriptExpression("String_Node_Str"));
  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.addFilter(filter1);
  cqd.addSort(sorter4);
  cqd.addSort(sorter5);
  DataEngineImpl engine=(DataEngineImpl)DataEngine.newDataEngine(DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null));
  this.createCube(engine);
  this.defineDataSourceDataSet(engine);
  IQueryDefinition query=this.createScriptDataSetQuery();
  IPreparedQuery pq=engine.prepare(query);
  IQueryResults queryResults=pq.execute(null);
  IResultIterator it=queryResults.getResultIterator();
  while (it.next()) {
    if ("String_Node_Str".equals(it.getValue("String_Node_Str").toString()) || "String_Node_Str".equals(it.getValue("String_Node_Str").toString())) {
      this.testPrintln("String_Node_Str" + it.getValue("String_Node_Str").toString());
      IPreparedCubeQuery pcq=engine.prepare(cqd,null);
      ICubeQueryResults cqResults=(ICubeQueryResults)pcq.execute(queryResults,null);
      CubeCursor cursor=cqResults.getCubeCursor();
      List columnEdgeBindingNames=new ArrayList();
      columnEdgeBindingNames.add("String_Node_Str");
      columnEdgeBindingNames.add("String_Node_Str");
      columnEdgeBindingNames.add("String_Node_Str");
      printCube(cursor,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},"String_Node_Str","String_Node_Str",false);
    }
  }
  this.checkOutputFile();
}