Program: 74922
Project: 74922
Buggy source:
private void createCube(IDocArchiveWriter writter,DataEngine engine) throws BirtException, IOException {
  CubeMaterializer cubeMaterializer=new CubeMaterializer(documentPath + engine.hashCode(),"String_Node_Str");
  IDocumentManager documentManager=cubeMaterializer.getDocumentManager();
  Dimension[] dimensions=new Dimension[2];
  String[] levelNames=new String[3];
  levelNames[0]="String_Node_Str";
  levelNames[1]="String_Node_Str";
  levelNames[2]="String_Node_Str";
  DimensionForTest iterator=new DimensionForTest(levelNames);
  iterator.setLevelMember(0,TestFactTable.DIM0_L1Col);
  iterator.setLevelMember(1,TestFactTable.DIM0_L2Col);
  iterator.setLevelMember(2,TestFactTable.DIM0_L3Col);
  ILevelDefn[] levelDefs=new ILevelDefn[3];
  levelDefs[0]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[1]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[2]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  dimensions[0]=(Dimension)DimensionFactory.createDimension("String_Node_Str",documentManager,iterator,levelDefs,false);
  IHierarchy hierarchy=dimensions[0].getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  assertEquals(dimensions[0].length(),13);
  levelNames=new String[1];
  levelNames[0]="String_Node_Str";
  iterator=new DimensionForTest(levelNames);
  iterator.setLevelMember(0,distinct(TestFactTable.DIM1_L1Col));
  levelDefs=new ILevelDefn[1];
  levelDefs[0]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  dimensions[1]=(Dimension)DimensionFactory.createDimension("String_Node_Str",documentManager,iterator,levelDefs,false);
  hierarchy=dimensions[1].getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  assertEquals(dimensions[1].length(),5);
  TestFactTable factTable2=new TestFactTable();
  String[] measureColumnName=new String[1];
  measureColumnName[0]="String_Node_Str";
  Cube cube=new Cube(cubeName,documentManager);
  cube.create(CubeUtility.getKeyColNames(dimensions),dimensions,factTable2,measureColumnName,new StopSign());
  cube.close();
  documentManager.flush();
  cubeMaterializer.saveCubeToReportDocument("String_Node_Str",writter,null);
  cubeMaterializer.close();
}

Fixed version (ground truth):
private void createCube(IDocArchiveWriter writter,DataEngine engine) throws BirtException, IOException {
  CubeMaterializer cubeMaterializer=new CubeMaterializer(engine,documentPath + engine.hashCode(),"String_Node_Str");
  IDocumentManager documentManager=cubeMaterializer.getDocumentManager();
  Dimension[] dimensions=new Dimension[2];
  String[] levelNames=new String[3];
  levelNames[0]="String_Node_Str";
  levelNames[1]="String_Node_Str";
  levelNames[2]="String_Node_Str";
  DimensionForTest iterator=new DimensionForTest(levelNames);
  iterator.setLevelMember(0,TestFactTable.DIM0_L1Col);
  iterator.setLevelMember(1,TestFactTable.DIM0_L2Col);
  iterator.setLevelMember(2,TestFactTable.DIM0_L3Col);
  ILevelDefn[] levelDefs=new ILevelDefn[3];
  levelDefs[0]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[1]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  levelDefs[2]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  dimensions[0]=(Dimension)DimensionFactory.createDimension("String_Node_Str",documentManager,iterator,levelDefs,false);
  IHierarchy hierarchy=dimensions[0].getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  assertEquals(dimensions[0].length(),13);
  levelNames=new String[1];
  levelNames[0]="String_Node_Str";
  iterator=new DimensionForTest(levelNames);
  iterator.setLevelMember(0,distinct(TestFactTable.DIM1_L1Col));
  levelDefs=new ILevelDefn[1];
  levelDefs[0]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},null);
  dimensions[1]=(Dimension)DimensionFactory.createDimension("String_Node_Str",documentManager,iterator,levelDefs,false);
  hierarchy=dimensions[1].getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  assertEquals(dimensions[1].length(),5);
  TestFactTable factTable2=new TestFactTable();
  String[] measureColumnName=new String[1];
  measureColumnName[0]="String_Node_Str";
  Cube cube=new Cube(cubeName,documentManager);
  cube.create(CubeUtility.getKeyColNames(dimensions),dimensions,factTable2,measureColumnName,new StopSign());
  cube.close();
  documentManager.flush();
  cubeMaterializer.saveCubeToReportDocument("String_Node_Str",writter,null);
  cubeMaterializer.close();
}