Program: 76054
Project: 76054
Buggy source:
private void testDimensionCreate(IDocumentManager documentManager) throws IOException, BirtException, DataException {
  ILevelDefn[] levelDefs=new ILevelDefn[1];
  String[] attrs={"String_Node_Str","String_Node_Str"};
  levelDefs[0]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},attrs);
  IDimension dimension=DimensionFactory.createDimension("String_Node_Str",documentManager,new OneLevelDataset(),levelDefs,false);
  IHierarchy hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  ILevel[] level=hierarchy.getLevels();
  assertEquals(level[0].getName(),"String_Node_Str");
  Dimension realDimension=(Dimension)dimension;
  for (int i=0; i < OneLevelDataset.IDCol.length; i++) {
    IndexKey indexKey=realDimension.findFirst((Level)level[0],new Object[]{new Integer(OneLevelDataset.IDCol[i])});
    assertEquals(indexKey.key[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(indexKey.dimensionPos,i);
    Member levelMember=realDimension.getRowByPosition(indexKey.dimensionPos).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.getAttributes()[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.getAttributes()[1],OneLevelDataset.AgeCol[i]);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.getAttributes()[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.getAttributes()[1],OneLevelDataset.AgeCol[i]);
  }
}

Fixed version (ground truth):
private void testDimensionCreate(IDocumentManager documentManager) throws IOException, BirtException, DataException {
  ILevelDefn[] levelDefs=new ILevelDefn[1];
  String[] attrs={"String_Node_Str","String_Node_Str"};
  levelDefs[0]=new LevelDefinition("String_Node_Str",new String[]{"String_Node_Str"},attrs);
  IDimension dimension=DimensionFactory.createDimension("String_Node_Str",documentManager,new OneLevelDataset(),levelDefs,false);
  IHierarchy hierarchy=dimension.getHierarchy();
  assertEquals(hierarchy.getName(),"String_Node_Str");
  ILevel[] level=hierarchy.getLevels();
  assertEquals(level[0].getName(),"String_Node_Str");
  Dimension realDimension=(Dimension)dimension;
  for (int i=0; i < OneLevelDataset.IDCol.length; i++) {
    IndexKey indexKey=realDimension.findFirst((Level)level[0],new Object[]{new Integer(OneLevelDataset.IDCol[i])});
    assertEquals(indexKey.getKey()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(indexKey.getDimensionPos(),i);
    Member levelMember=realDimension.getRowByPosition(indexKey.getDimensionPos()).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.getAttributes()[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.getAttributes()[1],OneLevelDataset.AgeCol[i]);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.getOffset()).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(OneLevelDataset.IDCol[i]));
    assertEquals(levelMember.getAttributes()[0],OneLevelDataset.NameCol[i]);
    assertEquals(levelMember.getAttributes()[1],OneLevelDataset.AgeCol[i]);
  }
}