Program: 64999
Project: 64999
Buggy source:
/** 
 * Test parser and properties of table element.
 * @throws Exception
 */
public void testParser() throws Exception {
  openDesign(fileName);
  save();
  TableHandle table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  assertEquals("String_Node_Str",table.getEventHandlerClass());
  assertTrue(table.newHandlerOnEachEvent());
  assertEquals("String_Node_Str",table.getOnCreate());
  assertEquals("String_Node_Str",table.getOnRender());
  assertEquals("String_Node_Str",table.getOnPrepare());
  assertFalse(table.repeatHeader());
  assertEquals("String_Node_Str",table.getCaption());
  assertEquals("String_Node_Str",table.getCaptionKey());
  assertEquals("String_Node_Str",table.getSummary());
  assertEquals(3,table.getColumnCount());
  assertEquals("String_Node_Str",table.getRole());
  assertEquals("String_Node_Str",table.getLanguage());
  assertEquals(1,table.getOrder());
  Iterator sorts=table.sortsIterator();
  SortKeyHandle sortHandle=(SortKeyHandle)sorts.next();
  assertEquals("String_Node_Str",sortHandle.getKey());
  assertEquals("String_Node_Str",sortHandle.getDirection());
  sortHandle=(SortKeyHandle)sorts.next();
  assertEquals("String_Node_Str",sortHandle.getKey());
  assertEquals("String_Node_Str",sortHandle.getDirection());
  assertNull(sorts.next());
  Iterator filters=table.filtersIterator();
  FilterConditionHandle filterHandle=(FilterConditionHandle)filters.next();
  assertEquals("String_Node_Str",filterHandle.getOperator());
  assertEquals("String_Node_Str",filterHandle.getExpr());
  assertEquals("String_Node_Str",filterHandle.getValue1());
  assertEquals("String_Node_Str",filterHandle.getValue2());
  assertFalse(table.isSortByGroups());
  SlotHandle headerSlot=table.getHeader();
  assertNotNull(headerSlot);
  RowHandle rowHandle=(RowHandle)headerSlot.get(0);
  assertFalse(rowHandle.repeatable());
  testReadVisibilityRules(rowHandle);
  assertEquals(1,headerSlot.getCount());
  SlotHandle detailSlot=table.getDetail();
  assertNotNull(detailSlot);
  assertEquals(1,detailSlot.getCount());
  RowHandle row=(RowHandle)detailSlot.get(0);
  assertTrue(row.suppressDuplicates());
  assertEquals("String_Node_Str",row.getBookmark());
  assertEquals("String_Node_Str",row.getBookmarkDisplayName());
  assertEquals("String_Node_Str",row.getEventHandlerClass());
  assertTrue(row.newHandlerOnEachEvent());
  assertEquals("String_Node_Str",row.getOnCreate());
  assertEquals("String_Node_Str",row.getOnRender());
  assertEquals("String_Node_Str",row.getOnPrepare());
  assertEquals("String_Node_Str",row.getRole());
  assertEquals("String_Node_Str",row.getLanguage());
  SlotHandle headSlot=table.getHeader();
  RowHandle headRow=(RowHandle)headSlot.get(0);
  assertEquals("String_Node_Str",headRow.getRole());
  ColumnHandle column=(ColumnHandle)table.getColumns().get(2);
  assertTrue(column.getBooleanProperty(TableColumn.SUPPRESS_DUPLICATES_PROP));
  Iterator hideRules=column.visibilityRulesIterator();
  assertTrue(hideRules.hasNext());
  HideRuleHandle hideRule=(HideRuleHandle)hideRules.next();
  assertEquals(DesignChoiceConstants.FORMAT_TYPE_VIEWER,hideRule.getFormat());
  assertEquals("String_Node_Str",hideRule.getExpression());
  SlotHandle cells=row.getCells();
  assertNotNull(cells);
  assertEquals(1,cells.getCount());
  CellHandle cell=(CellHandle)cells.get(0);
  assertEquals("String_Node_Str",cell.getBookmark());
  assertEquals("String_Node_Str",cell.getBookmarkDisplayName());
  assertEquals("String_Node_Str",cell.getEventHandlerClass());
  assertTrue(cell.newHandlerOnEachEvent());
  assertEquals("String_Node_Str",cell.getOnCreate());
  assertEquals("String_Node_Str",cell.getOnRender());
  assertEquals("String_Node_Str",cell.getOnPrepare());
  SlotHandle groupSlot=table.getGroups();
  assertNotNull(groupSlot);
  assertEquals(1,groupSlot.getCount());
  TableGroupHandle group=(TableGroupHandle)groupSlot.get(0);
  assertEquals(DesignChoiceConstants.INTERVAL_WEEK,group.getInterval());
  assertTrue(3.0 == group.getIntervalRange());
  assertEquals("String_Node_Str",group.getSortDirection());
  assertEquals("String_Node_Str",group.getKeyExpr());
  assertEquals("String_Node_Str",group.getTOC().getExpression());
  assertEquals("String_Node_Str",group.getACLExpression());
  assertFalse(group.cascadeACL());
  assertEquals("String_Node_Str",group.getBookmark());
  assertEquals("String_Node_Str",group.getBookmarkDisplayName());
  assertEquals("String_Node_Str",group.getEventHandlerClass());
  assertTrue(group.newHandlerOnEachEvent());
  assertEquals("String_Node_Str",group.getOnCreate());
  assertEquals("String_Node_Str",group.getOnRender());
  assertEquals("String_Node_Str",group.getOnPrepare());
  sorts=group.sortsIterator();
  sortHandle=(SortKeyHandle)sorts.next();
  assertEquals("String_Node_Str",sortHandle.getKey());
  assertEquals("String_Node_Str",sortHandle.getDirection());
  sortHandle=(SortKeyHandle)sorts.next();
  assertEquals("String_Node_Str",sortHandle.getKey());
  assertEquals("String_Node_Str",sortHandle.getDirection());
  filters=group.filtersIterator();
  filterHandle=(FilterConditionHandle)filters.next();
  assertEquals("String_Node_Str",filterHandle.getOperator());
  assertEquals("String_Node_Str",filterHandle.getExpr());
  assertEquals("String_Node_Str",filterHandle.getValue1());
  assertEquals("String_Node_Str",filterHandle.getValue2());
  SlotHandle groupHeaderSlot=group.getHeader();
  assertEquals(2,groupHeaderSlot.getCount());
  SlotHandle groupFooterSlot=group.getFooter();
  assertEquals(1,groupFooterSlot.getCount());
  SlotHandle footerSlot=table.getFooter();
  assertNotNull(footerSlot);
  assertEquals(1,footerSlot.getCount());
  rowHandle=(RowHandle)footerSlot.get(0);
  assertTrue(rowHandle.repeatable());
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  assertEquals("String_Node_Str",table.getRole());
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
}

Fixed version (ground truth):
/** 
 * Test parser and properties of table element.
 * @throws Exception
 */
public void testParser() throws Exception {
  openDesign(fileName);
  save();
  TableHandle table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  assertEquals("String_Node_Str",table.getEventHandlerClass());
  assertTrue(table.newHandlerOnEachEvent());
  assertEquals("String_Node_Str",table.getOnCreate());
  assertEquals("String_Node_Str",table.getOnRender());
  assertEquals("String_Node_Str",table.getOnPrepare());
  assertFalse(table.repeatHeader());
  assertEquals("String_Node_Str",table.getCaption());
  assertEquals("String_Node_Str",table.getCaptionKey());
  assertEquals("String_Node_Str",table.getSummary());
  assertEquals(3,table.getColumnCount());
  assertEquals("String_Node_Str",table.getTagType());
  assertEquals("String_Node_Str",table.getLanguage());
  assertEquals(1,table.getOrder());
  Iterator sorts=table.sortsIterator();
  SortKeyHandle sortHandle=(SortKeyHandle)sorts.next();
  assertEquals("String_Node_Str",sortHandle.getKey());
  assertEquals("String_Node_Str",sortHandle.getDirection());
  sortHandle=(SortKeyHandle)sorts.next();
  assertEquals("String_Node_Str",sortHandle.getKey());
  assertEquals("String_Node_Str",sortHandle.getDirection());
  assertNull(sorts.next());
  Iterator filters=table.filtersIterator();
  FilterConditionHandle filterHandle=(FilterConditionHandle)filters.next();
  assertEquals("String_Node_Str",filterHandle.getOperator());
  assertEquals("String_Node_Str",filterHandle.getExpr());
  assertEquals("String_Node_Str",filterHandle.getValue1());
  assertEquals("String_Node_Str",filterHandle.getValue2());
  assertFalse(table.isSortByGroups());
  SlotHandle headerSlot=table.getHeader();
  assertNotNull(headerSlot);
  RowHandle rowHandle=(RowHandle)headerSlot.get(0);
  assertFalse(rowHandle.repeatable());
  testReadVisibilityRules(rowHandle);
  assertEquals(1,headerSlot.getCount());
  SlotHandle detailSlot=table.getDetail();
  assertNotNull(detailSlot);
  assertEquals(1,detailSlot.getCount());
  RowHandle row=(RowHandle)detailSlot.get(0);
  assertTrue(row.suppressDuplicates());
  assertEquals("String_Node_Str",row.getBookmark());
  assertEquals("String_Node_Str",row.getBookmarkDisplayName());
  assertEquals("String_Node_Str",row.getEventHandlerClass());
  assertTrue(row.newHandlerOnEachEvent());
  assertEquals("String_Node_Str",row.getOnCreate());
  assertEquals("String_Node_Str",row.getOnRender());
  assertEquals("String_Node_Str",row.getOnPrepare());
  assertEquals("String_Node_Str",row.getTagType());
  assertEquals("String_Node_Str",row.getLanguage());
  SlotHandle headSlot=table.getHeader();
  RowHandle headRow=(RowHandle)headSlot.get(0);
  assertEquals("String_Node_Str",headRow.getTagType());
  ColumnHandle column=(ColumnHandle)table.getColumns().get(2);
  assertTrue(column.getBooleanProperty(TableColumn.SUPPRESS_DUPLICATES_PROP));
  Iterator hideRules=column.visibilityRulesIterator();
  assertTrue(hideRules.hasNext());
  HideRuleHandle hideRule=(HideRuleHandle)hideRules.next();
  assertEquals(DesignChoiceConstants.FORMAT_TYPE_VIEWER,hideRule.getFormat());
  assertEquals("String_Node_Str",hideRule.getExpression());
  SlotHandle cells=row.getCells();
  assertNotNull(cells);
  assertEquals(1,cells.getCount());
  CellHandle cell=(CellHandle)cells.get(0);
  assertEquals("String_Node_Str",cell.getBookmark());
  assertEquals("String_Node_Str",cell.getBookmarkDisplayName());
  assertEquals("String_Node_Str",cell.getEventHandlerClass());
  assertTrue(cell.newHandlerOnEachEvent());
  assertEquals("String_Node_Str",cell.getOnCreate());
  assertEquals("String_Node_Str",cell.getOnRender());
  assertEquals("String_Node_Str",cell.getOnPrepare());
  SlotHandle groupSlot=table.getGroups();
  assertNotNull(groupSlot);
  assertEquals(1,groupSlot.getCount());
  TableGroupHandle group=(TableGroupHandle)groupSlot.get(0);
  assertEquals(DesignChoiceConstants.INTERVAL_WEEK,group.getInterval());
  assertTrue(3.0 == group.getIntervalRange());
  assertEquals("String_Node_Str",group.getSortDirection());
  assertEquals("String_Node_Str",group.getKeyExpr());
  assertEquals("String_Node_Str",group.getTOC().getExpression());
  assertEquals("String_Node_Str",group.getACLExpression());
  assertFalse(group.cascadeACL());
  assertEquals("String_Node_Str",group.getBookmark());
  assertEquals("String_Node_Str",group.getBookmarkDisplayName());
  assertEquals("String_Node_Str",group.getEventHandlerClass());
  assertTrue(group.newHandlerOnEachEvent());
  assertEquals("String_Node_Str",group.getOnCreate());
  assertEquals("String_Node_Str",group.getOnRender());
  assertEquals("String_Node_Str",group.getOnPrepare());
  sorts=group.sortsIterator();
  sortHandle=(SortKeyHandle)sorts.next();
  assertEquals("String_Node_Str",sortHandle.getKey());
  assertEquals("String_Node_Str",sortHandle.getDirection());
  sortHandle=(SortKeyHandle)sorts.next();
  assertEquals("String_Node_Str",sortHandle.getKey());
  assertEquals("String_Node_Str",sortHandle.getDirection());
  filters=group.filtersIterator();
  filterHandle=(FilterConditionHandle)filters.next();
  assertEquals("String_Node_Str",filterHandle.getOperator());
  assertEquals("String_Node_Str",filterHandle.getExpr());
  assertEquals("String_Node_Str",filterHandle.getValue1());
  assertEquals("String_Node_Str",filterHandle.getValue2());
  SlotHandle groupHeaderSlot=group.getHeader();
  assertEquals(2,groupHeaderSlot.getCount());
  SlotHandle groupFooterSlot=group.getFooter();
  assertEquals(1,groupFooterSlot.getCount());
  SlotHandle footerSlot=table.getFooter();
  assertNotNull(footerSlot);
  assertEquals(1,footerSlot.getCount());
  rowHandle=(RowHandle)footerSlot.get(0);
  assertTrue(rowHandle.repeatable());
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  assertEquals("String_Node_Str",table.getTagType());
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
  table=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(table);
}