Program: 76065
Project: 76065
Buggy source:
private void testDimensionFind3(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]});
    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]);
    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]);
    assertTrue(levelMember.attributes == null);
    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]);
    assertEquals(levelMember.attributes.length,1);
    assertEquals(levelMember.attributes[0],new Integer(ThreeLevelDataset.Level3AttributeCol[i]));
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).members[2];
    assertEquals(levelMember.keyValues[0],ThreeLevelDataset.Level3Col[i]);
    assertEquals(levelMember.attributes.length,1);
    assertEquals(levelMember.attributes[0],new Integer(ThreeLevelDataset.Level3AttributeCol[i]));
  }
}

Fixed version (ground truth):
private void testDimensionFind3(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]});
    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]);
    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]);
    assertTrue(levelMember.getAttributes() == null);
    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]);
    assertEquals(levelMember.getAttributes().length,1);
    assertEquals(levelMember.getAttributes()[0],new Integer(ThreeLevelDataset.Level3AttributeCol[i]));
    levelMember=realDimension.getDimensionRowByOffset(indexKey.offset).getMembers()[2];
    assertEquals(levelMember.getKeyValues()[0],ThreeLevelDataset.Level3Col[i]);
    assertEquals(levelMember.getAttributes().length,1);
    assertEquals(levelMember.getAttributes()[0],new Integer(ThreeLevelDataset.Level3AttributeCol[i]));
  }
}