Program: 64991
Project: 64991
Buggy source:
/** 
 * Test parser and its properties.
 * @throws Exception
 */
public void testParser() throws Exception {
  openDesign(fileName);
  SlotHandle body=designHandle.getBody();
  GridHandle grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  assertEquals(0,body.findPosn(grid));
  assertEquals("String_Node_Str",grid.getSummary());
  assertEquals("String_Node_Str",grid.getCaption());
  assertEquals("String_Node_Str",grid.getCaptionKey());
  assertEquals("String_Node_Str",grid.getRole());
  assertEquals("String_Node_Str",grid.getLanguage());
  assertEquals(1,grid.getOrder());
  SlotHandle columns=grid.getColumns();
  assertEquals(2,columns.getCount());
  ColumnHandle column=(ColumnHandle)columns.get(0);
  assertEquals(2.5,column.getWidth().getMeasure(),0.1);
  assertEquals(3,column.getRepeatCount());
  assertEquals("String_Node_Str",column.getStyle().getName());
  assertNull(column.getPropertyDefn(Style.PAGE_BREAK_INSIDE_PROP));
  SlotHandle rows=grid.getRows();
  assertEquals(2,rows.getCount());
  RowHandle row=(RowHandle)rows.get(0);
  assertEquals(5,row.getHeight().getMeasure(),1);
  assertEquals("String_Node_Str",row.getBookmark());
  assertEquals("String_Node_Str",row.getStyle().getName());
  SlotHandle cells=row.getCells();
  assertEquals(2,cells.getCount());
  CellHandle cell=(CellHandle)cells.get(0);
  assertEquals(DesignChoiceConstants.LINE_STYLE_NONE,cell.getDiagonalStyle());
  assertEquals(DesignChoiceConstants.LINE_STYLE_NONE,cell.getAntidiagonalStyle());
  assertEquals(0,cell.getDiagonalNumber());
  assertEquals(0,cell.getAntidiagonalNumber());
  assertEquals(ColorPropertyType.BLACK,cell.getDiagonalColor().getStringValue());
  assertEquals(ColorPropertyType.BLACK,cell.getAntidiagonalColor().getStringValue());
  DimensionHandle dimensionHandle=cell.getDiagonalThickness();
  assertEquals(DesignChoiceConstants.LINE_WIDTH_MEDIUM,dimensionHandle.getStringValue());
  dimensionHandle=cell.getAntidiagonalThickness();
  assertEquals(DesignChoiceConstants.LINE_WIDTH_MEDIUM,dimensionHandle.getStringValue());
  assertEquals("String_Node_Str",cell.getRole());
  cell=(CellHandle)cells.get(1);
  assertEquals(2,cell.getColumn());
  assertEquals(3,cell.getColumnSpan());
  assertEquals(1,cell.getRowSpan());
  assertEquals("String_Node_Str",cell.getDrop());
  assertEquals("String_Node_Str",cell.getHeight().getStringValue());
  assertEquals("String_Node_Str",cell.getWidth().getStringValue());
  assertEquals("String_Node_Str",cell.getPrivateStyle().getBackgroundColor().getStringValue());
  assertEquals("String_Node_Str",cell.getRole());
  assertEquals("String_Node_Str",cell.getLanguage());
  assertEquals("String_Node_Str",cell.getAltText());
  SlotHandle content=cell.getContent();
  LabelHandle label=(LabelHandle)content.get(0);
  assertEquals("String_Node_Str",label.getName());
  assertEquals(DesignChoiceConstants.LINE_STYLE_SOLID,cell.getDiagonalStyle());
  assertEquals(DesignChoiceConstants.LINE_STYLE_DASHED,cell.getAntidiagonalStyle());
  assertEquals(10,cell.getDiagonalNumber());
  assertEquals(20,cell.getAntidiagonalNumber());
  assertEquals(ColorPropertyType.RED,cell.getDiagonalColor().getStringValue());
  assertEquals(ColorPropertyType.BLUE,cell.getAntidiagonalColor().getStringValue());
  dimensionHandle=cell.getDiagonalThickness();
  assertEquals("String_Node_Str",dimensionHandle.getStringValue());
  dimensionHandle=cell.getAntidiagonalThickness();
  assertEquals("String_Node_Str",dimensionHandle.getStringValue());
  assertEquals(DesignChoiceConstants.SCOPE_TYPE_ROWGROUP,cell.getScope());
  assertEquals("String_Node_Str",cell.getBookmark());
  assertEquals("String_Node_Str",cell.getHeaders());
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertEquals("String_Node_Str",grid.getRole());
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
}

Fixed version (ground truth):
/** 
 * Test parser and its properties.
 * @throws Exception
 */
public void testParser() throws Exception {
  openDesign(fileName);
  SlotHandle body=designHandle.getBody();
  GridHandle grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  assertEquals(0,body.findPosn(grid));
  assertEquals("String_Node_Str",grid.getSummary());
  assertEquals("String_Node_Str",grid.getCaption());
  assertEquals("String_Node_Str",grid.getCaptionKey());
  assertEquals("String_Node_Str",grid.getTagType());
  assertEquals("String_Node_Str",grid.getLanguage());
  assertEquals(1,grid.getOrder());
  SlotHandle columns=grid.getColumns();
  assertEquals(2,columns.getCount());
  ColumnHandle column=(ColumnHandle)columns.get(0);
  assertEquals(2.5,column.getWidth().getMeasure(),0.1);
  assertEquals(3,column.getRepeatCount());
  assertEquals("String_Node_Str",column.getStyle().getName());
  assertNull(column.getPropertyDefn(Style.PAGE_BREAK_INSIDE_PROP));
  SlotHandle rows=grid.getRows();
  assertEquals(2,rows.getCount());
  RowHandle row=(RowHandle)rows.get(0);
  assertEquals(5,row.getHeight().getMeasure(),1);
  assertEquals("String_Node_Str",row.getBookmark());
  assertEquals("String_Node_Str",row.getStyle().getName());
  SlotHandle cells=row.getCells();
  assertEquals(2,cells.getCount());
  CellHandle cell=(CellHandle)cells.get(0);
  assertEquals(DesignChoiceConstants.LINE_STYLE_NONE,cell.getDiagonalStyle());
  assertEquals(DesignChoiceConstants.LINE_STYLE_NONE,cell.getAntidiagonalStyle());
  assertEquals(0,cell.getDiagonalNumber());
  assertEquals(0,cell.getAntidiagonalNumber());
  assertEquals(ColorPropertyType.BLACK,cell.getDiagonalColor().getStringValue());
  assertEquals(ColorPropertyType.BLACK,cell.getAntidiagonalColor().getStringValue());
  DimensionHandle dimensionHandle=cell.getDiagonalThickness();
  assertEquals(DesignChoiceConstants.LINE_WIDTH_MEDIUM,dimensionHandle.getStringValue());
  dimensionHandle=cell.getAntidiagonalThickness();
  assertEquals(DesignChoiceConstants.LINE_WIDTH_MEDIUM,dimensionHandle.getStringValue());
  assertEquals("String_Node_Str",cell.getTagType());
  cell=(CellHandle)cells.get(1);
  assertEquals(2,cell.getColumn());
  assertEquals(3,cell.getColumnSpan());
  assertEquals(1,cell.getRowSpan());
  assertEquals("String_Node_Str",cell.getDrop());
  assertEquals("String_Node_Str",cell.getHeight().getStringValue());
  assertEquals("String_Node_Str",cell.getWidth().getStringValue());
  assertEquals("String_Node_Str",cell.getPrivateStyle().getBackgroundColor().getStringValue());
  assertEquals("String_Node_Str",cell.getTagType());
  assertEquals("String_Node_Str",cell.getLanguage());
  assertEquals("String_Node_Str",cell.getAltText());
  SlotHandle content=cell.getContent();
  LabelHandle label=(LabelHandle)content.get(0);
  assertEquals("String_Node_Str",label.getName());
  assertEquals(DesignChoiceConstants.LINE_STYLE_SOLID,cell.getDiagonalStyle());
  assertEquals(DesignChoiceConstants.LINE_STYLE_DASHED,cell.getAntidiagonalStyle());
  assertEquals(10,cell.getDiagonalNumber());
  assertEquals(20,cell.getAntidiagonalNumber());
  assertEquals(ColorPropertyType.RED,cell.getDiagonalColor().getStringValue());
  assertEquals(ColorPropertyType.BLUE,cell.getAntidiagonalColor().getStringValue());
  dimensionHandle=cell.getDiagonalThickness();
  assertEquals("String_Node_Str",dimensionHandle.getStringValue());
  dimensionHandle=cell.getAntidiagonalThickness();
  assertEquals("String_Node_Str",dimensionHandle.getStringValue());
  assertEquals(DesignChoiceConstants.SCOPE_TYPE_ROWGROUP,cell.getScope());
  assertEquals("String_Node_Str",cell.getBookmark());
  assertEquals("String_Node_Str",cell.getHeaders());
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertEquals("String_Node_Str",grid.getTagType());
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
  grid=(GridHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(grid);
}