Program: 65000
Project: 65000
Buggy source:
/** 
 * This test writes the design file and compare it with golden file.
 * @throws Exception
 */
public void testWriter() throws Exception {
  openDesign(fileName);
  TableHandle tableHandle=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(tableHandle);
  tableHandle.setEventHandlerClass("String_Node_Str");
  tableHandle.setOnCreate("String_Node_Str");
  tableHandle.setOnPrepare("String_Node_Str");
  tableHandle.setOnRender("String_Node_Str");
  tableHandle.setRepeatHeader(false);
  tableHandle.setCaption("String_Node_Str");
  tableHandle.setCaptionKey("String_Node_Str");
  tableHandle.setSummary("String_Node_Str");
  tableHandle.setSortByGroups(true);
  tableHandle.setNewHandlerOnEachEvent(false);
  tableHandle.setRole("String_Node_Str");
  tableHandle.setLanguage("String_Node_Str");
  tableHandle.setOrder(1);
  ColumnHandle column=(ColumnHandle)tableHandle.getColumns().get(2);
  PropertyHandle propHandle=column.getPropertyHandle(TableColumn.VISIBILITY_PROP);
  propHandle.setValue(null);
  HideRule hideRule=StructureFactory.createHideRule();
  propHandle.addItem(hideRule);
  hideRule.setFormat(DesignChoiceConstants.FORMAT_TYPE_REPORTLET);
  hideRule.setExpression("String_Node_Str" + DesignChoiceConstants.FORMAT_TYPE_REPORTLET);
  SlotHandle groupSlot=tableHandle.getGroups();
  assertNotNull(groupSlot);
  assertEquals(1,groupSlot.getCount());
  RowHandle rowHandle=(RowHandle)tableHandle.getHeader().get(0);
  testWriteVisibilityRules(rowHandle);
  rowHandle=(RowHandle)tableHandle.getFooter().get(0);
  rowHandle.setRepeatable(false);
  TableGroupHandle group=(TableGroupHandle)groupSlot.get(0);
  group.setName("String_Node_Str");
  group.setInterval(DesignChoiceConstants.INTERVAL_DAY);
  group.setIntervalRange(99);
  group.setKeyExpr("String_Node_Str");
  group.setBookmark("String_Node_Str");
  group.setBookmarkDisplayName("String_Node_Str");
  group.getTOC().setExpression("String_Node_Str");
  group.setEventHandlerClass("String_Node_Str");
  group.setOnPrepare("String_Node_Str");
  group.setOnCreate("String_Node_Str");
  group.setOnRender("String_Node_Str");
  group.setACLExpression("String_Node_Str");
  group.setCascadeACL(true);
  SlotHandle detailSlot=tableHandle.getDetail();
  assertNotNull(detailSlot);
  assertEquals(1,detailSlot.getCount());
  RowHandle row=(RowHandle)detailSlot.get(0);
  row.setSuppressDuplicates(false);
  row.setEventHandlerClass("String_Node_Str");
  row.setOnCreate("String_Node_Str");
  row.setOnPrepare("String_Node_Str");
  row.setOnRender(null);
  row.setBookmark("String_Node_Str");
  row.setBookmarkDisplayName("String_Node_Str");
  row.setRole("String_Node_Str");
  row.setLanguage("String_Node_Str");
  SlotHandle cells=row.getCells();
  assertNotNull(cells);
  assertEquals(1,cells.getCount());
  CellHandle cell=(CellHandle)cells.get(0);
  cell.setEventHandlerClass("String_Node_Str");
  cell.setOnCreate(null);
  cell.setOnPrepare("String_Node_Str");
  cell.setOnRender("String_Node_Str");
  cell.setBookmark("String_Node_Str");
  cell.setBookmarkDisplayName("String_Node_Str");
  UserPropertyDefn prop=new UserPropertyDefn();
  prop.setName("String_Node_Str");
  PropertyType typeDefn=MetaDataDictionary.getInstance().getPropertyType(PropertyType.STRING_TYPE_NAME);
  prop.setType(typeDefn);
  cell.addUserPropertyDefn(prop);
  save();
  assertTrue(compareFile(goldenFileName));
}

Fixed version (ground truth):
/** 
 * This test writes the design file and compare it with golden file.
 * @throws Exception
 */
public void testWriter() throws Exception {
  openDesign(fileName);
  TableHandle tableHandle=(TableHandle)designHandle.findElement("String_Node_Str");
  assertNotNull(tableHandle);
  tableHandle.setEventHandlerClass("String_Node_Str");
  tableHandle.setOnCreate("String_Node_Str");
  tableHandle.setOnPrepare("String_Node_Str");
  tableHandle.setOnRender("String_Node_Str");
  tableHandle.setRepeatHeader(false);
  tableHandle.setCaption("String_Node_Str");
  tableHandle.setCaptionKey("String_Node_Str");
  tableHandle.setSummary("String_Node_Str");
  tableHandle.setSortByGroups(true);
  tableHandle.setNewHandlerOnEachEvent(false);
  tableHandle.setTagType("String_Node_Str");
  tableHandle.setLanguage("String_Node_Str");
  tableHandle.setOrder(1);
  ColumnHandle column=(ColumnHandle)tableHandle.getColumns().get(2);
  PropertyHandle propHandle=column.getPropertyHandle(TableColumn.VISIBILITY_PROP);
  propHandle.setValue(null);
  HideRule hideRule=StructureFactory.createHideRule();
  propHandle.addItem(hideRule);
  hideRule.setFormat(DesignChoiceConstants.FORMAT_TYPE_REPORTLET);
  hideRule.setExpression("String_Node_Str" + DesignChoiceConstants.FORMAT_TYPE_REPORTLET);
  SlotHandle groupSlot=tableHandle.getGroups();
  assertNotNull(groupSlot);
  assertEquals(1,groupSlot.getCount());
  RowHandle rowHandle=(RowHandle)tableHandle.getHeader().get(0);
  testWriteVisibilityRules(rowHandle);
  rowHandle=(RowHandle)tableHandle.getFooter().get(0);
  rowHandle.setRepeatable(false);
  TableGroupHandle group=(TableGroupHandle)groupSlot.get(0);
  group.setName("String_Node_Str");
  group.setInterval(DesignChoiceConstants.INTERVAL_DAY);
  group.setIntervalRange(99);
  group.setKeyExpr("String_Node_Str");
  group.setBookmark("String_Node_Str");
  group.setBookmarkDisplayName("String_Node_Str");
  group.getTOC().setExpression("String_Node_Str");
  group.setEventHandlerClass("String_Node_Str");
  group.setOnPrepare("String_Node_Str");
  group.setOnCreate("String_Node_Str");
  group.setOnRender("String_Node_Str");
  group.setACLExpression("String_Node_Str");
  group.setCascadeACL(true);
  SlotHandle detailSlot=tableHandle.getDetail();
  assertNotNull(detailSlot);
  assertEquals(1,detailSlot.getCount());
  RowHandle row=(RowHandle)detailSlot.get(0);
  row.setSuppressDuplicates(false);
  row.setEventHandlerClass("String_Node_Str");
  row.setOnCreate("String_Node_Str");
  row.setOnPrepare("String_Node_Str");
  row.setOnRender(null);
  row.setBookmark("String_Node_Str");
  row.setBookmarkDisplayName("String_Node_Str");
  row.setTagType("String_Node_Str");
  row.setLanguage("String_Node_Str");
  SlotHandle cells=row.getCells();
  assertNotNull(cells);
  assertEquals(1,cells.getCount());
  CellHandle cell=(CellHandle)cells.get(0);
  cell.setEventHandlerClass("String_Node_Str");
  cell.setOnCreate(null);
  cell.setOnPrepare("String_Node_Str");
  cell.setOnRender("String_Node_Str");
  cell.setBookmark("String_Node_Str");
  cell.setBookmarkDisplayName("String_Node_Str");
  UserPropertyDefn prop=new UserPropertyDefn();
  prop.setName("String_Node_Str");
  PropertyType typeDefn=MetaDataDictionary.getInstance().getPropertyType(PropertyType.STRING_TYPE_NAME);
  prop.setType(typeDefn);
  cell.addUserPropertyDefn(prop);
  save();
  assertTrue(compareFile(goldenFileName));
}