Program: 64888
Project: 64888
Buggy source:
/** 
 * Test localize element.
 * @throws DesignFileException
 * @throws IOException
 * @throws SemanticException
 */
public void testLocalizeElement() throws DesignFileException, IOException, SemanticException {
  openDesign("String_Node_Str");
  Module module=designHandle.getModule();
  LabelHandle label1Handle=(LabelHandle)designHandle.findElement("String_Node_Str");
  Label label1=(Label)label1Handle.getElement();
  assertEquals("String_Node_Str",label1Handle.getExtends().getName());
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Label.WIDTH_PROP).toString());
  assertEquals(null,label1.getLocalProperty(module,Label.TEXT_PROP));
  assertEquals(null,label1.getLocalProperty(module,Style.FONT_SIZE_PROP));
  assertEquals(null,label1.getLocalProperty(module,Style.BORDER_LEFT_COLOR_PROP));
  assertEquals(null,label1.getLocalProperty(module,Style.BACKGROUND_COLOR_PROP));
  assertEquals("String_Node_Str",label1.getStringProperty(module,Style.TEXT_ALIGN_PROP));
  label1Handle.localize();
  assertNull(label1Handle.getExtends());
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Label.WIDTH_PROP).toString());
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Label.TEXT_PROP));
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Style.FONT_SIZE_PROP).toString());
  assertEquals(null,label1.getLocalProperty(module,Style.BORDER_LEFT_COLOR_PROP));
  assertEquals(null,label1.getLocalProperty(module,Style.BACKGROUND_COLOR_PROP));
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Style.TEXT_ALIGN_PROP));
  GridHandle grid1Handle=(GridHandle)designHandle.findElement("String_Node_Str");
  GridItem grid1=(GridItem)grid1Handle.getElement();
  assertEquals("String_Node_Str",grid1.getExtendsName());
  assertEquals("String_Node_Str",grid1.getLocalProperty(module,GridItem.HEIGHT_PROP).toString());
  assertEquals("String_Node_Str",grid1.getProperty(module,GridItem.WIDTH_PROP).toString());
  RowHandle innerRow1=(RowHandle)grid1Handle.getRows().get(0);
  CellHandle innerCell1=(CellHandle)innerRow1.getCells().get(0);
  LabelHandle innerLabel1=(LabelHandle)innerCell1.getContent().get(0);
  GridHandle innerGrid1=(GridHandle)innerCell1.getContent().get(2);
  assertTrue(innerRow1.getElement().isVirtualElement());
  assertTrue(innerLabel1.getElement().isVirtualElement());
  assertEquals(9,innerLabel1.getElement().getBaseId());
  assertEquals("String_Node_Str",innerLabel1.getElement().getLocalProperty(module,Label.TEXT_PROP).toString());
  assertEquals(null,innerLabel1.getElement().getLocalProperty(module,Style.COLOR_PROP));
  assertEquals(null,innerLabel1.getElement().getLocalProperty(module,Style.FONT_SIZE_PROP));
  assertEquals(null,innerGrid1.getElement().getLocalProperty(module,Style.MAP_RULES_PROP));
  List mapRules=(List)innerGrid1.getProperty(Style.MAP_RULES_PROP);
  assertEquals(1,mapRules.size());
  grid1Handle.localize();
  assertNull(grid1.getExtendsElement());
  assertEquals("String_Node_Str",grid1.getLocalProperty(module,GridItem.HEIGHT_PROP).toString());
  assertEquals("String_Node_Str",grid1.getLocalProperty(module,GridItem.WIDTH_PROP).toString());
  List localMapRules=(List)grid1.getLocalProperty(module,Style.MAP_RULES_PROP);
  assertEquals(2,localMapRules.size());
  Structure numberFormat=(Structure)grid1.getLocalProperty(module,Style.NUMBER_FORMAT_PROP);
  assertEquals("String_Node_Str",numberFormat.getProperty(module,NumberFormatValue.CATEGORY_MEMBER));
  save();
  design.getActivityStack().undo();
  design.getActivityStack().undo();
  save();
}

Fixed version (ground truth):
/** 
 * Test localize element.
 * @throws DesignFileException
 * @throws IOException
 * @throws SemanticException
 */
public void testLocalizeElement() throws DesignFileException, IOException, SemanticException {
  openDesign("String_Node_Str");
  Module module=designHandle.getModule();
  LabelHandle label1Handle=(LabelHandle)designHandle.findElement("String_Node_Str");
  Label label1=(Label)label1Handle.getElement();
  assertEquals("String_Node_Str",label1Handle.getExtends().getName());
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Label.WIDTH_PROP).toString());
  assertEquals(null,label1.getLocalProperty(module,Label.TEXT_PROP));
  assertEquals(null,label1.getLocalProperty(module,Style.FONT_SIZE_PROP));
  assertEquals(null,label1.getLocalProperty(module,Style.BORDER_LEFT_COLOR_PROP));
  assertEquals(null,label1.getLocalProperty(module,Style.BACKGROUND_COLOR_PROP));
  assertEquals("String_Node_Str",label1.getStringProperty(module,Style.TEXT_ALIGN_PROP));
  label1Handle.localize();
  assertNull(label1Handle.getExtends());
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Label.WIDTH_PROP).toString());
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Label.TEXT_PROP));
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Style.FONT_SIZE_PROP).toString());
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Style.BORDER_LEFT_COLOR_PROP));
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Style.BACKGROUND_COLOR_PROP));
  assertEquals("String_Node_Str",label1.getLocalProperty(module,Style.TEXT_ALIGN_PROP));
  GridHandle grid1Handle=(GridHandle)designHandle.findElement("String_Node_Str");
  GridItem grid1=(GridItem)grid1Handle.getElement();
  assertEquals("String_Node_Str",grid1.getExtendsName());
  assertEquals("String_Node_Str",grid1.getLocalProperty(module,GridItem.HEIGHT_PROP).toString());
  assertEquals("String_Node_Str",grid1.getProperty(module,GridItem.WIDTH_PROP).toString());
  RowHandle innerRow1=(RowHandle)grid1Handle.getRows().get(0);
  CellHandle innerCell1=(CellHandle)innerRow1.getCells().get(0);
  LabelHandle innerLabel1=(LabelHandle)innerCell1.getContent().get(0);
  GridHandle innerGrid1=(GridHandle)innerCell1.getContent().get(2);
  assertTrue(innerRow1.getElement().isVirtualElement());
  assertTrue(innerLabel1.getElement().isVirtualElement());
  assertEquals(9,innerLabel1.getElement().getBaseId());
  assertEquals("String_Node_Str",innerLabel1.getElement().getLocalProperty(module,Label.TEXT_PROP).toString());
  assertEquals(null,innerLabel1.getElement().getLocalProperty(module,Style.COLOR_PROP));
  assertEquals(null,innerLabel1.getElement().getLocalProperty(module,Style.FONT_SIZE_PROP));
  assertEquals(null,innerGrid1.getElement().getLocalProperty(module,Style.MAP_RULES_PROP));
  List mapRules=(List)innerGrid1.getProperty(Style.MAP_RULES_PROP);
  assertEquals(1,mapRules.size());
  grid1Handle.localize();
  assertNull(grid1.getExtendsElement());
  assertEquals("String_Node_Str",grid1.getLocalProperty(module,GridItem.HEIGHT_PROP).toString());
  assertEquals("String_Node_Str",grid1.getLocalProperty(module,GridItem.WIDTH_PROP).toString());
  List localMapRules=(List)grid1.getLocalProperty(module,Style.MAP_RULES_PROP);
  assertEquals(2,localMapRules.size());
  Structure numberFormat=(Structure)grid1.getLocalProperty(module,Style.NUMBER_FORMAT_PROP);
  assertEquals("String_Node_Str",numberFormat.getProperty(module,NumberFormatValue.CATEGORY_MEMBER));
  save();
  design.getActivityStack().undo();
  design.getActivityStack().undo();
  save();
}