Program: 72664
Project: 72664
Buggy source:
/** 
 * Test use aggregation with one more arguments, referenced using "dimension".
 * @throws Exception
 */
public void testAddingNestAggregations() 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");
  hier1.createLevel("String_Node_Str");
  hier1.createLevel("String_Node_Str");
  hier1.createLevel("String_Node_Str");
  IDimensionDefinition dim2=rowEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier2=dim2.createHierarchy("String_Node_Str");
  hier2.createLevel("String_Node_Str");
  cqd.createMeasure("String_Node_Str");
  IBinding binding1=new Binding("String_Node_Str");
  binding1.setExpression(new ScriptExpression("String_Node_Str"));
  cqd.addBinding(binding1);
  IBinding binding2=new Binding("String_Node_Str");
  binding2.setExpression(new ScriptExpression("String_Node_Str"));
  cqd.addBinding(binding2);
  IBinding binding3=new Binding("String_Node_Str");
  binding3.setExpression(new ScriptExpression("String_Node_Str"));
  cqd.addBinding(binding3);
  IBinding binding4=new Binding("String_Node_Str");
  binding4.setExpression(new ScriptExpression("String_Node_Str"));
  cqd.addBinding(binding4);
  IBinding binding5=new Binding("String_Node_Str");
  binding5.setExpression(new ScriptExpression("String_Node_Str"));
  cqd.addBinding(binding5);
  IBinding binding6=new Binding("String_Node_Str");
  binding6.setExpression(new ScriptExpression("String_Node_Str"));
  binding6.setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);
  binding6.addAggregateOn("String_Node_Str");
  binding6.addAggregateOn("String_Node_Str");
  binding6.addAggregateOn("String_Node_Str");
  cqd.addBinding(binding6);
  IBinding binding7=new Binding("String_Node_Str");
  binding7.setExpression(new ScriptExpression("String_Node_Str"));
  binding7.setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);
  binding7.addAggregateOn("String_Node_Str");
  binding7.addAggregateOn("String_Node_Str");
  IBinding binding8=new Binding("String_Node_Str");
  binding8.setExpression(new ScriptExpression("String_Node_Str"));
  binding8.addAggregateOn("String_Node_Str");
  binding8.setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);
  IBinding binding9=new Binding("String_Node_Str");
  binding9.setExpression(new ScriptExpression("String_Node_Str"));
  binding9.setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);
  binding9.addAggregateOn("String_Node_Str");
  ICubeOperation cubeOperation1=new AddingNestAggregations(new IBinding[]{binding7,binding8});
  ICubeOperation cubeOperation2=new AddingNestAggregations(new IBinding[]{binding9});
  cqd.addCubeOperation(cubeOperation1);
  cqd.addCubeOperation(cubeOperation2);
  DataEngineImpl engine=(DataEngineImpl)DataEngine.newDataEngine(createPresentationContext());
  this.createCube(engine);
  IPreparedCubeQuery pcq=engine.prepare(cqd,null);
  ICubeQueryResults queryResults=pcq.execute(null);
  CubeCursor cursor=queryResults.getCubeCursor();
  List columnEdgeBindingNames=new ArrayList();
  columnEdgeBindingNames.add("String_Node_Str");
  columnEdgeBindingNames.add("String_Node_Str");
  columnEdgeBindingNames.add("String_Node_Str");
  List rowEdgeBindingNames=new ArrayList();
  rowEdgeBindingNames.add("String_Node_Str");
  this.printCube(cursor,columnEdgeBindingNames,rowEdgeBindingNames,"String_Node_Str",new String[0]);
  this.checkOutputFile();
  cursor.close();
}

Fixed version (ground truth):
/** 
 * Test adding nest aggregations cube operation	
 * @throws Exception
 */
public void testAddingNestAggregations() 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");
  hier1.createLevel("String_Node_Str");
  hier1.createLevel("String_Node_Str");
  hier1.createLevel("String_Node_Str");
  IDimensionDefinition dim2=rowEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier2=dim2.createHierarchy("String_Node_Str");
  hier2.createLevel("String_Node_Str");
  cqd.createMeasure("String_Node_Str");
  IBinding binding1=new Binding("String_Node_Str");
  binding1.setExpression(new ScriptExpression("String_Node_Str"));
  cqd.addBinding(binding1);
  IBinding binding2=new Binding("String_Node_Str");
  binding2.setExpression(new ScriptExpression("String_Node_Str"));
  cqd.addBinding(binding2);
  IBinding binding3=new Binding("String_Node_Str");
  binding3.setExpression(new ScriptExpression("String_Node_Str"));
  cqd.addBinding(binding3);
  IBinding binding4=new Binding("String_Node_Str");
  binding4.setExpression(new ScriptExpression("String_Node_Str"));
  cqd.addBinding(binding4);
  IBinding binding5=new Binding("String_Node_Str");
  binding5.setExpression(new ScriptExpression("String_Node_Str"));
  cqd.addBinding(binding5);
  IBinding binding6=new Binding("String_Node_Str");
  binding6.setExpression(new ScriptExpression("String_Node_Str"));
  binding6.setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);
  binding6.addAggregateOn("String_Node_Str");
  binding6.addAggregateOn("String_Node_Str");
  binding6.addAggregateOn("String_Node_Str");
  cqd.addBinding(binding6);
  IBinding binding7=new Binding("String_Node_Str");
  binding7.setExpression(new ScriptExpression("String_Node_Str"));
  binding7.setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);
  binding7.addAggregateOn("String_Node_Str");
  binding7.addAggregateOn("String_Node_Str");
  IBinding binding8=new Binding("String_Node_Str");
  binding8.setExpression(new ScriptExpression("String_Node_Str"));
  binding8.setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);
  binding8.addAggregateOn("String_Node_Str");
  IBinding binding9=new Binding("String_Node_Str");
  binding9.setExpression(new ScriptExpression("String_Node_Str"));
  binding9.setAggrFunction(IBuildInAggregation.TOTAL_SUM_FUNC);
  binding9.addAggregateOn("String_Node_Str");
  IBinding binding10=new Binding("String_Node_Str");
  binding10.setExpression(new ScriptExpression("String_Node_Str"));
  binding10.setAggrFunction(IBuildInAggregation.TOTAL_MAX_FUNC);
  binding10.addAggregateOn("String_Node_Str");
  binding10.addAggregateOn("String_Node_Str");
  binding10.addAggregateOn("String_Node_Str");
  IBinding binding11=new Binding("String_Node_Str");
  binding11.setExpression(new ScriptExpression("String_Node_Str"));
  binding11.setAggrFunction(IBuildInAggregation.TOTAL_MAX_FUNC);
  ICubeOperation cubeOperation1=new AddingNestAggregations(new IBinding[]{binding7,binding8,binding10,binding11});
  ICubeOperation cubeOperation2=new AddingNestAggregations(new IBinding[]{binding9});
  cqd.addCubeOperation(cubeOperation1);
  cqd.addCubeOperation(cubeOperation2);
  DataEngineImpl engine=(DataEngineImpl)DataEngine.newDataEngine(createPresentationContext());
  this.createCube(engine);
  IPreparedCubeQuery pcq=engine.prepare(cqd,null);
  ICubeQueryResults queryResults=pcq.execute(null);
  CubeCursor cursor=queryResults.getCubeCursor();
  List columnEdgeBindingNames=new ArrayList();
  columnEdgeBindingNames.add("String_Node_Str");
  columnEdgeBindingNames.add("String_Node_Str");
  columnEdgeBindingNames.add("String_Node_Str");
  List rowEdgeBindingNames=new ArrayList();
  rowEdgeBindingNames.add("String_Node_Str");
  this.printCube(cursor,columnEdgeBindingNames,rowEdgeBindingNames,"String_Node_Str",new String[0]);
  this.checkOutputFile();
  cursor.close();
}