Program: 76077
Project: 76077
Buggy source:
private void testDimensionCreateAndFind(IDocumentManager documentManager) throws IOException, BirtException, DataException {
  Dimension dimension=createDimension(documentManager);
  ILevel[] level=dimension.getHierarchy().getLevels();
  IDiskArray indexKeys=dimension.find((Level)level[0],new Object[]{new Integer(1)});
  assertEquals(indexKeys.size(),4);
  IndexKey indexKey;
  Member levelMember;
  for (int i=0; i < 4; i++) {
    indexKey=(IndexKey)indexKeys.get(i);
    assertEquals(indexKey.key[0],new Integer(1));
    assertEquals(indexKey.dimensionPos,i);
    levelMember=dimension.getRowByPosition(indexKey.dimensionPos).members[0];
    assertEquals(levelMember.keyValues[0],new Integer(1));
    levelMember=dimension.getDimensionRowByOffset(indexKey.offset).members[0];
    assertEquals(levelMember.keyValues[0],new Integer(1));
  }
  dimension=(Dimension)DimensionFactory.loadDimension("String_Node_Str",documentManager);
  indexKeys=dimension.find((Level)level[1],new Object[]{new Integer(1)});
  assertEquals(indexKeys.size(),4);
  indexKey=(IndexKey)indexKeys.get(0);
  assertEquals(indexKey.key[0],new Integer(1));
  assertEquals(indexKey.dimensionPos,0);
  levelMember=dimension.getDimensionRowByOffset(indexKey.offset).members[1];
  assertEquals(levelMember.keyValues[0],new Integer(1));
  indexKey=(IndexKey)indexKeys.get(1);
  assertEquals(indexKey.key[0],new Integer(1));
  assertEquals(indexKey.dimensionPos,1);
  levelMember=dimension.getDimensionRowByOffset(indexKey.offset).members[1];
  assertEquals(levelMember.keyValues[0],new Integer(1));
  indexKey=(IndexKey)indexKeys.get(2);
  assertEquals(indexKey.key[0],new Integer(1));
  assertEquals(indexKey.dimensionPos,4);
  levelMember=dimension.getDimensionRowByOffset(indexKey.offset).members[1];
  assertEquals(levelMember.keyValues[0],new Integer(1));
  indexKey=(IndexKey)indexKeys.get(3);
  assertEquals(indexKey.key[0],new Integer(1));
  assertEquals(indexKey.dimensionPos,5);
  levelMember=dimension.getDimensionRowByOffset(indexKey.offset).members[1];
  assertEquals(levelMember.keyValues[0],new Integer(1));
}

Fixed version (ground truth):
private void testDimensionCreateAndFind(IDocumentManager documentManager) throws IOException, BirtException, DataException {
  Dimension dimension=createDimension(documentManager);
  ILevel[] level=dimension.getHierarchy().getLevels();
  IDiskArray indexKeys=dimension.find((Level)level[0],new Object[]{new Integer(1)});
  assertEquals(indexKeys.size(),4);
  IndexKey indexKey;
  Member levelMember;
  for (int i=0; i < 4; i++) {
    indexKey=(IndexKey)indexKeys.get(i);
    assertEquals(indexKey.key[0],new Integer(1));
    assertEquals(indexKey.dimensionPos,i);
    levelMember=dimension.getRowByPosition(indexKey.dimensionPos).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(1));
    levelMember=dimension.getDimensionRowByOffset(indexKey.offset).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],new Integer(1));
  }
  dimension=(Dimension)DimensionFactory.loadDimension("String_Node_Str",documentManager);
  indexKeys=dimension.find((Level)level[1],new Object[]{new Integer(1)});
  assertEquals(indexKeys.size(),4);
  indexKey=(IndexKey)indexKeys.get(0);
  assertEquals(indexKey.key[0],new Integer(1));
  assertEquals(indexKey.dimensionPos,0);
  levelMember=dimension.getDimensionRowByOffset(indexKey.offset).getMembers()[1];
  assertEquals(levelMember.getKeyValues()[0],new Integer(1));
  indexKey=(IndexKey)indexKeys.get(1);
  assertEquals(indexKey.key[0],new Integer(1));
  assertEquals(indexKey.dimensionPos,1);
  levelMember=dimension.getDimensionRowByOffset(indexKey.offset).getMembers()[1];
  assertEquals(levelMember.getKeyValues()[0],new Integer(1));
  indexKey=(IndexKey)indexKeys.get(2);
  assertEquals(indexKey.key[0],new Integer(1));
  assertEquals(indexKey.dimensionPos,4);
  levelMember=dimension.getDimensionRowByOffset(indexKey.offset).getMembers()[1];
  assertEquals(levelMember.getKeyValues()[0],new Integer(1));
  indexKey=(IndexKey)indexKeys.get(3);
  assertEquals(indexKey.key[0],new Integer(1));
  assertEquals(indexKey.dimensionPos,5);
  levelMember=dimension.getDimensionRowByOffset(indexKey.offset).getMembers()[1];
  assertEquals(levelMember.getKeyValues()[0],new Integer(1));
}