Program: 76066
Project: 76066
Buggy source:
private void testDimensionFind2(IDocumentManager documentManager) throws DataException, IOException {
  IDimension dimension;
  IHierarchy hierarchy;
  ILevel[] level;
  Dimension realDimension;
  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;
  for (int i=0; i < ThreeLevelDataset.Level1Col.length; i++) {
    IndexKey indexKey=realDimension.findFirst((Level)level[0],new Object[]{ThreeLevelDataset.Level1Col[i]});
    assertEquals(indexKey.key[0],ThreeLevelDataset.Level1Col[i]);
    if (i < 5)     assertEquals(indexKey.dimensionPos,0);
    if (i >= 5 && i < 12)     assertEquals(indexKey.dimensionPos,5);
    if (i >= 12)     assertEquals(indexKey.dimensionPos,12);
    Member levelMember=realDimension.getRowByPosition(indexKey.dimensionPos).members[0];
    assertEquals(levelMember.keyValues[0],ThreeLevelDataset.Level1Col[i]);
    assertTrue(levelMember.attributes == null);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[0];
    assertEquals(levelMember.keyValues[0],ThreeLevelDataset.Level1Col[i]);
    assertTrue(levelMember.attributes == null);
    indexKey=realDimension.findFirst((Level)level[1],new Object[]{ThreeLevelDataset.Level2Col[i]});
    assertEquals(indexKey.key[0],ThreeLevelDataset.Level2Col[i]);
    levelMember=realDimension.getRowByPosition(indexKey.dimensionPos).members[1];
    assertEquals(levelMember.keyValues[0],ThreeLevelDataset.Level2Col[i]);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[1];
    assertEquals(levelMember.keyValues[0],ThreeLevelDataset.Level2Col[i]);
    assertTrue(levelMember.attributes == null);
    indexKey=realDimension.findFirst((Level)level[2],new Object[]{ThreeLevelDataset.Level3Col[i]});
    assertEquals(indexKey.key[0],ThreeLevelDataset.Level3Col[i]);
    assertEquals(indexKey.dimensionPos,i);
    levelMember=realDimension.getRowByPosition(indexKey.dimensionPos).members[2];
    assertEquals(levelMember.keyValues[0],ThreeLevelDataset.Level3Col[i]);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[2];
    assertEquals(levelMember.keyValues[0],ThreeLevelDataset.Level3Col[i]);
  }
}

Fixed version (ground truth):
private void testDimensionFind2(IDocumentManager documentManager) throws DataException, IOException {
  IDimension dimension;
  IHierarchy hierarchy;
  ILevel[] level;
  Dimension realDimension;
  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;
  for (int i=0; i < ThreeLevelDataset.Level1Col.length; i++) {
    IndexKey indexKey=realDimension.findFirst((Level)level[0],new Object[]{ThreeLevelDataset.Level1Col[i]});
    assertEquals(indexKey.key[0],ThreeLevelDataset.Level1Col[i]);
    if (i < 5)     assertEquals(indexKey.dimensionPos,0);
    if (i >= 5 && i < 12)     assertEquals(indexKey.dimensionPos,5);
    if (i >= 12)     assertEquals(indexKey.dimensionPos,12);
    Member levelMember=realDimension.getRowByPosition(indexKey.dimensionPos).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],ThreeLevelDataset.Level1Col[i]);
    assertTrue(levelMember.getAttributes() == null);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[0];
    assertEquals(levelMember.getKeyValues()[0],ThreeLevelDataset.Level1Col[i]);
    assertTrue(levelMember.getAttributes() == null);
    indexKey=realDimension.findFirst((Level)level[1],new Object[]{ThreeLevelDataset.Level2Col[i]});
    assertEquals(indexKey.key[0],ThreeLevelDataset.Level2Col[i]);
    levelMember=realDimension.getRowByPosition(indexKey.dimensionPos).getMembers()[1];
    assertEquals(levelMember.getKeyValues()[0],ThreeLevelDataset.Level2Col[i]);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[1];
    assertEquals(levelMember.getKeyValues()[0],ThreeLevelDataset.Level2Col[i]);
    assertTrue(levelMember.getAttributes() == null);
    indexKey=realDimension.findFirst((Level)level[2],new Object[]{ThreeLevelDataset.Level3Col[i]});
    assertEquals(indexKey.key[0],ThreeLevelDataset.Level3Col[i]);
    assertEquals(indexKey.dimensionPos,i);
    levelMember=realDimension.getRowByPosition(indexKey.dimensionPos).getMembers()[2];
    assertEquals(levelMember.getKeyValues()[0],ThreeLevelDataset.Level3Col[i]);
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[2];
    assertEquals(levelMember.getKeyValues()[0],ThreeLevelDataset.Level3Col[i]);
  }
}