Program: 73586
Project: 73586
Buggy source:
/** 
 * Test computed measure.
 * @throws Exception
 */
public void testComputedMeasureCache() 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.createComputedMeasure("String_Node_Str",DataType.DOUBLE_TYPE,new ScriptExpression("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);
  DataEngineImpl engine=(DataEngineImpl)DataEngine.newDataEngine(DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null));
  this.createCube(engine);
  cqd.setCacheQueryResults(true);
  IPreparedCubeQuery pcq=engine.prepare(cqd,null);
  ICubeQueryResults queryResults=pcq.execute(null);
  CubeCursor cursor=queryResults.getCubeCursor();
  cqd.setQueryResultsID(queryResults.getID());
  pcq=engine.prepare(cqd,null);
  queryResults=pcq.execute(null);
  cursor=queryResults.getCubeCursor();
  List columnEdgeBindingNames=new ArrayList();
  columnEdgeBindingNames.add("String_Node_Str");
  columnEdgeBindingNames.add("String_Node_Str");
  columnEdgeBindingNames.add("String_Node_Str");
  this.printCube(cursor,columnEdgeBindingNames,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test computed measure.
 * @throws Exception
 */
public void testComputedMeasureCache() 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.createComputedMeasure("String_Node_Str",DataType.DOUBLE_TYPE,new ScriptExpression("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);
  DataEngineImpl engine=(DataEngineImpl)DataEngine.newDataEngine(DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null));
  this.createCube(engine);
  cqd.setCacheQueryResults(true);
  IPreparedCubeQuery pcq=engine.prepare(cqd,null);
  ICubeQueryResults queryResults=pcq.execute(null);
  CubeCursor cursor=queryResults.getCubeCursor();
  cqd.setQueryResultsID(queryResults.getID());
  pcq=engine.prepare(cqd,null);
  queryResults=pcq.execute(null);
  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");
}