Program: 75525
Project: 75525
Buggy source:
/** 
 * Test clear all properties.
 * @throws SemanticException
 */
public void testClearAllProperties() throws SemanticException {
  ArrayList elements=new ArrayList();
  LabelHandle element1=elemFactory.newLabel("String_Node_Str");
  TextItemHandle element2=elemFactory.newTextItem("String_Node_Str");
  element1.setComments("String_Node_Str");
  element1.setHeight("String_Node_Str");
  element1.setWidth("String_Node_Str");
  element1.setAction(new Action());
  element2.setComments("String_Node_Str");
  element2.setHeight("String_Node_Str");
  element2.setWidth("String_Node_Str");
  element2.setContent("String_Node_Str");
  elements.add(element2);
  elements.add(element1);
  GroupElementHandle groupElementHandle=new SimpleGroupElementHandle(designHandle,elements);
  assertEquals("String_Node_Str",groupElementHandle.getStringProperty(ReportItemHandle.HEIGHT_PROP));
  assertEquals("String_Node_Str",groupElementHandle.getStringProperty(ReportItemHandle.COMMENTS_PROP));
  assertNull(groupElementHandle.getStringProperty(ReportItemHandle.WIDTH_PROP));
  assertNull(groupElementHandle.getStringProperty(TextItemHandle.CONTENT_PROP));
  groupElementHandle.clearLocalProperties();
  assertNull(groupElementHandle.getStringProperty(ReportItemHandle.HEIGHT_PROP));
  assertNull(groupElementHandle.getStringProperty(ReportItemHandle.COMMENTS_PROP));
  assertEquals("String_Node_Str",element2.getContent());
  assertNotNull(element1.getActionHandle());
  assertEquals("String_Node_Str",element2.getContent());
  assertNotNull(element1.getActionHandle());
  LabelHandle baseLabel1=elemFactory.newLabel("String_Node_Str");
  LabelHandle baseLabel2=elemFactory.newLabel("String_Node_Str");
  designHandle.getComponents().add(baseLabel1);
  designHandle.getComponents().add(baseLabel2);
  LabelHandle label1=(LabelHandle)elemFactory.newElementFrom(baseLabel1,"String_Node_Str");
  LabelHandle label2=(LabelHandle)elemFactory.newElementFrom(baseLabel2,"String_Node_Str");
  elements=new ArrayList();
  elements.add(label1);
  elements.add(label2);
  groupElementHandle=new SimpleGroupElementHandle(designHandle,elements);
  groupElementHandle.clearLocalProperties();
  assertNotNull(label1.getExtends());
  assertNotNull(label2.getExtends());
  ElementFactory elemFactory=new ElementFactory(design);
  DesignElementHandle masterPage1=elemFactory.newGraphicMasterPage("String_Node_Str");
  designHandle.getMasterPages().add(masterPage1);
  elements.clear();
  elements.add(masterPage1);
  elements.add(label1);
  groupElementHandle=new SimpleGroupElementHandle(designHandle,elements);
  groupElementHandle.clearLocalProperties();
}

Fixed version (ground truth):
/** 
 * Test clear all properties.
 * @throws SemanticException
 */
public void testClearAllProperties() throws SemanticException {
  ArrayList elements=new ArrayList();
  LabelHandle element1=elemFactory.newLabel("String_Node_Str");
  TextItemHandle element2=elemFactory.newTextItem("String_Node_Str");
  element1.setComments("String_Node_Str");
  element1.setHeight("String_Node_Str");
  element1.setWidth("String_Node_Str");
  element1.setAction(new Action());
  element2.setComments("String_Node_Str");
  element2.setHeight("String_Node_Str");
  element2.setWidth("String_Node_Str");
  element2.setContent("String_Node_Str");
  elements.add(element2);
  elements.add(element1);
  GroupElementHandle groupElementHandle=new SimpleGroupElementHandle(designHandle,elements);
  assertEquals("String_Node_Str",groupElementHandle.getStringProperty(ReportItemHandle.HEIGHT_PROP));
  assertEquals("String_Node_Str",groupElementHandle.getStringProperty(ReportItemHandle.COMMENTS_PROP));
  assertNull(groupElementHandle.getStringProperty(ReportItemHandle.WIDTH_PROP));
  assertNull(groupElementHandle.getStringProperty(TextItemHandle.CONTENT_PROP));
  groupElementHandle.clearLocalProperties();
  assertNull(groupElementHandle.getStringProperty(ReportItemHandle.HEIGHT_PROP));
  assertNull(groupElementHandle.getStringProperty(ReportItemHandle.COMMENTS_PROP));
  assertEquals("String_Node_Str",element2.getContent());
  assertNotNull(element1.getActionHandle());
  assertEquals("String_Node_Str",element2.getContent());
  assertNotNull(element1.getActionHandle());
  LabelHandle baseLabel1=elemFactory.newLabel("String_Node_Str");
  LabelHandle baseLabel2=elemFactory.newLabel("String_Node_Str");
  designHandle.getComponents().add(baseLabel1);
  designHandle.getComponents().add(baseLabel2);
  LabelHandle label1=(LabelHandle)elemFactory.newElementFrom(baseLabel1,"String_Node_Str");
  LabelHandle label2=(LabelHandle)elemFactory.newElementFrom(baseLabel2,"String_Node_Str");
  elements=new ArrayList();
  elements.add(label1);
  elements.add(label2);
  groupElementHandle=new SimpleGroupElementHandle(designHandle,elements);
  groupElementHandle.clearLocalProperties();
  assertNotNull(label1.getExtends());
  assertNotNull(label2.getExtends());
  DesignElementHandle masterPage1=elemFactory.newGraphicMasterPage("String_Node_Str");
  designHandle.getMasterPages().add(masterPage1);
  elements.clear();
  elements.add(masterPage1);
  elements.add(label1);
  groupElementHandle=new SimpleGroupElementHandle(designHandle,elements);
  groupElementHandle.clearLocalProperties();
  DesignElementHandle parentExtendedItem=elemFactory.newExtendedItem("String_Node_Str","String_Node_Str");
  designHandle.getComponents().add(parentExtendedItem);
  DesignElementHandle childExtendedItem=elemFactory.newElementFrom(parentExtendedItem,"String_Node_Str");
  designHandle.getBody().add(childExtendedItem);
  assertEquals(new Integer(0),parentExtendedItem.getProperty("String_Node_Str"));
  assertEquals(new Integer(0),childExtendedItem.getProperty("String_Node_Str"));
  elements.clear();
  elements.add(childExtendedItem);
  groupElementHandle=new SimpleGroupElementHandle(designHandle,elements);
  childExtendedItem.setProperty("String_Node_Str","String_Node_Str");
  assertEquals(new Integer(0),parentExtendedItem.getProperty("String_Node_Str"));
  assertEquals(new Integer(3),childExtendedItem.getProperty("String_Node_Str"));
  assertTrue(groupElementHandle.hasLocalPropertiesForExtendedElements());
  groupElementHandle.clearLocalProperties();
  ((ExtendedItemHandle)childExtendedItem).loadExtendedElement();
  assertEquals(new Integer(0),parentExtendedItem.getProperty("String_Node_Str"));
  assertEquals(new Integer(0),childExtendedItem.getProperty("String_Node_Str"));
  design.getActivityStack().undo();
  ((ExtendedItemHandle)childExtendedItem).loadExtendedElement();
  assertEquals(new Integer(0),parentExtendedItem.getProperty("String_Node_Str"));
  assertEquals(new Integer(3),childExtendedItem.getProperty("String_Node_Str"));
  design.getActivityStack().redo();
  ((ExtendedItemHandle)childExtendedItem).loadExtendedElement();
  assertEquals(new Integer(0),parentExtendedItem.getProperty("String_Node_Str"));
  assertEquals(new Integer(0),childExtendedItem.getProperty("String_Node_Str"));
}