Program: 73324
Project: 73324
Buggy source:
/** 
 * Creats sub menu in the specified action group of the specified menu manager.
 * @param menuManager The menu manager contains the action group.
 * @param group_name The action group contains the sub menu.
 */
private void createDeleteGroupMenus(IMenuManager menuManager,String group_name){
  ReportElementEditPart editPart=null;
  if (getFirstElement() instanceof RowHandle) {
    DesignElementHandle container=((RowHandle)getFirstElement()).getContainer();
    if (container instanceof TableGroupHandle) {
      editPart=getTableEditPart();
      Action action=new DeleteGroupAction(editPart,(TableGroupHandle)container);
      action.setText(DELETE_GROUP_MENU_ITEM_TEXT);
      menuManager.appendToGroup(group_name,action);
      return;
    }
  }
  if (getFirstElement() instanceof SlotHandle) {
    DesignElementHandle container=((SlotHandle)getFirstElement()).getElementHandle();
    if (container instanceof ListGroupHandle) {
      editPart=getListEditPart();
      Action action=new DeleteGroupAction(editPart,(ListGroupHandle)container);
      action.setText(DELETE_GROUP_MENU_ITEM_TEXT);
      menuManager.appendToGroup(group_name,action);
      return;
    }
  }
  MenuManager subMenu=new MenuManager(DELETE_GROUP_MENU_ITEM_TEXT);
  ListingHandle parentHandle=null;
  if (!getTableEditParts().isEmpty()) {
    parentHandle=(ListingHandle)((TableEditPart)getTableEditParts().get(0)).getModel();
    editPart=(TableEditPart)getTableEditParts().get(0);
  }
 else   if (!getListEditParts().isEmpty()) {
    parentHandle=(ListingHandle)((ListEditPart)getListEditParts().get(0)).getModel();
    editPart=(ListEditPart)getListEditParts().get(0);
  }
 else {
    return;
  }
  SlotHandle handle=parentHandle.getGroups();
  Iterator iter=handle.iterator();
  while (iter.hasNext()) {
    GroupHandle groupHandle=(GroupHandle)iter.next();
    subMenu.add(new DeleteGroupAction(editPart,groupHandle));
  }
  menuManager.appendToGroup(group_name,subMenu);
}

Fixed version (ground truth):
/** 
 * Creats sub menu in the specified action group of the specified menu manager.
 * @param menuManager The menu manager contains the action group.
 * @param group_name The action group contains the sub menu.
 */
private void createDeleteGroupMenus(IMenuManager menuManager,String group_name){
  ReportElementEditPart editPart=null;
  if (getFirstElement() instanceof RowHandle) {
    DesignElementHandle container=((RowHandle)getFirstElement()).getContainer();
    if (container instanceof TableGroupHandle) {
      editPart=getTableEditPart();
      Action action=new DeleteGroupAction(editPart,(TableGroupHandle)container);
      action.setText(DELETE_GROUP_MENU_ITEM_TEXT);
      menuManager.appendToGroup(group_name,action);
      return;
    }
  }
  if (getFirstElement() instanceof SlotHandle) {
    DesignElementHandle container=((SlotHandle)getFirstElement()).getElementHandle();
    if (container instanceof ListGroupHandle) {
      editPart=getListEditPart();
      Action action=new DeleteGroupAction(editPart,(ListGroupHandle)container);
      action.setText(DELETE_GROUP_MENU_ITEM_TEXT);
      menuManager.appendToGroup(group_name,action);
      return;
    }
  }
  MenuManager subMenu=new MenuManager(DELETE_GROUP_MENU_ITEM_TEXT);
  ListingHandle parentHandle=null;
  if (!getTableEditParts().isEmpty()) {
    parentHandle=(ListingHandle)((TableEditPart)getTableEditParts().get(0)).getModel();
    editPart=(TableEditPart)getTableEditParts().get(0);
  }
 else   if (!getTableMultipleEditParts().isEmpty()) {
    parentHandle=(ListingHandle)((ReportElementEditPart)getTableMultipleEditParts().get(0)).getModel();
    editPart=(ReportElementEditPart)getTableMultipleEditParts().get(0);
  }
 else   if (!getListEditParts().isEmpty()) {
    parentHandle=(ListingHandle)((ListEditPart)getListEditParts().get(0)).getModel();
    editPart=(ListEditPart)getListEditParts().get(0);
  }
 else {
    return;
  }
  SlotHandle handle=parentHandle.getGroups();
  Iterator iter=handle.iterator();
  while (iter.hasNext()) {
    GroupHandle groupHandle=(GroupHandle)iter.next();
    subMenu.add(new DeleteGroupAction(editPart,groupHandle));
  }
  menuManager.appendToGroup(group_name,subMenu);
}