Program: 76072
Project: 76072
Buggy source:
private void testDimensionCreateAndFind4(IDocumentManager documentManager) throws IOException, BirtException, DataException {
  ILevelDefn[] levelDefs=new ILevelDefn[3];
  String[] attrs={"String_Node_Str"};
  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"},attrs);
  IDimension dimension=DimensionFactory.createDimension("String_Node_Str",documentManager,new ThreeLevelDataset(),levelDefs,false);
  IHierarchy hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  ILevel[] level=hierarchy.getLevels();
  Dimension realDimension=(Dimension)dimension;
  IndexKey indexKey=realDimension.findFirst((Level)level[0],new Object[]{"String_Node_Str"});
  Member levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[0];
  assertEquals(levelMember.keyValues[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[0],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[0];
  assertEquals(levelMember.keyValues[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[0],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[0];
  assertEquals(levelMember.keyValues[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[1],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[1];
  assertEquals(levelMember.keyValues[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[1],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[1];
  assertEquals(levelMember.keyValues[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[1],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[1];
  assertEquals(levelMember.keyValues[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[2],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[2];
  assertEquals(levelMember.keyValues[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[2],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[2];
  assertEquals(levelMember.keyValues[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[2],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[2];
  assertEquals(levelMember.keyValues[0],"String_Node_Str");
  System.out.println("String_Node_Str");
  dimension=DimensionFactory.loadDimension("String_Node_Str",documentManager);
  System.out.println("String_Node_Str");
  hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  level=hierarchy.getLevels();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  level=hierarchy.getLevels();
  assertEquals(level[0].getName(),"String_Node_Str");
  assertEquals(level[0].getKeyDataType("String_Node_Str"),DataType.STRING_TYPE);
  assertEquals(level[1].getName(),"String_Node_Str");
  assertEquals(level[1].getKeyDataType("String_Node_Str"),DataType.STRING_TYPE);
  assertEquals(level[2].getName(),"String_Node_Str");
  assertEquals(level[2].getKeyDataType("String_Node_Str"),DataType.STRING_TYPE);
  realDimension=(Dimension)dimension;
}

Fixed version (ground truth):
private void testDimensionCreateAndFind4(IDocumentManager documentManager) throws IOException, BirtException, DataException {
  ILevelDefn[] levelDefs=new ILevelDefn[3];
  String[] attrs={"String_Node_Str"};
  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"},attrs);
  IDimension dimension=DimensionFactory.createDimension("String_Node_Str",documentManager,new ThreeLevelDataset(),levelDefs,false);
  IHierarchy hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  ILevel[] level=hierarchy.getLevels();
  Dimension realDimension=(Dimension)dimension;
  IndexKey indexKey=realDimension.findFirst((Level)level[0],new Object[]{"String_Node_Str"});
  Member levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[0];
  assertEquals(levelMember.getKeyValues()[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[0],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[0];
  assertEquals(levelMember.getKeyValues()[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[0],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[0];
  assertEquals(levelMember.getKeyValues()[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[1],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[1];
  assertEquals(levelMember.getKeyValues()[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[1],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[1];
  assertEquals(levelMember.getKeyValues()[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[1],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[1];
  assertEquals(levelMember.getKeyValues()[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[2],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[2];
  assertEquals(levelMember.getKeyValues()[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[2],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[2];
  assertEquals(levelMember.getKeyValues()[0],"String_Node_Str");
  indexKey=realDimension.findFirst((Level)level[2],new Object[]{"String_Node_Str"});
  levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[2];
  assertEquals(levelMember.getKeyValues()[0],"String_Node_Str");
  System.out.println("String_Node_Str");
  dimension=DimensionFactory.loadDimension("String_Node_Str",documentManager);
  System.out.println("String_Node_Str");
  hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  level=hierarchy.getLevels();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  level=hierarchy.getLevels();
  assertEquals(level[0].getName(),"String_Node_Str");
  assertEquals(level[0].getKeyDataType("String_Node_Str"),DataType.STRING_TYPE);
  assertEquals(level[1].getName(),"String_Node_Str");
  assertEquals(level[1].getKeyDataType("String_Node_Str"),DataType.STRING_TYPE);
  assertEquals(level[2].getName(),"String_Node_Str");
  assertEquals(level[2].getKeyDataType("String_Node_Str"),DataType.STRING_TYPE);
  realDimension=(Dimension)dimension;
}