Program: 33021
Project: 33021
Buggy source:
/** 
 * Prepare the Screen's standard options menu to be displayed.  This is called right before the menu is shown, every time it is shown.  You can use this method to efficiently enable/disable items or otherwise dynamically modify the contents.  See  {@link android.app.Activity#onPrepareOptionsMenu(android.view.Menu) Activity.onPrepareOptionsMenu}for more information.
 * @param menu The options menu as last shown or first initialized byonCreateOptionsMenu().
 * @see #setHasOptionsMenu
 * @see #onCreateOptionsMenu
 */
@Override public void onPrepareOptionsMenu(Menu menu){
  menu.clear();
  menu.add(Menu.NONE,MENU_ITEM_SEARCH,Menu.NONE,getString(R.string.search)).setIcon(new IconDrawable(getActivity(),Iconify.IconValue.fa_search).colorRes(R.color.black).actionBarSize()).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
  menu.addSubMenu(Menu.NONE,MENU_ITEM_DATA_TABLES,Menu.NONE,Constants.DATA_TABLE_CLIENTS_NAME);
  menu.add(Menu.NONE,MENU_ITEM_DOCUMENTS,Menu.NONE,getString(R.string.documents));
  menu.add(Menu.NONE,MENU_ITEM_IDENTIFIERS,Menu.NONE,getString(R.string.identifiers));
  int SUBMENU_ITEM_ID=0;
  SubMenu dataTableSubMenu=menu.getItem(0).getSubMenu();
  if (dataTableSubMenu != null && clientDataTables != null && clientDataTables.size() > 0) {
    Iterator<DataTable> dataTableIterator=clientDataTables.iterator();
    while (dataTableIterator.hasNext()) {
      dataTableSubMenu.add(Menu.NONE,SUBMENU_ITEM_ID,Menu.NONE,dataTableIterator.next().getRegisteredTableName());
      SUBMENU_ITEM_ID++;
    }
  }
  super.onPrepareOptionsMenu(menu);
}

Fixed version (ground truth):
/** 
 * Prepare the Screen's standard options menu to be displayed.  This is called right before the menu is shown, every time it is shown.  You can use this method to efficiently enable/disable items or otherwise dynamically modify the contents.  See  {@link android.app.Activity#onPrepareOptionsMenu(android.view.Menu) Activity.onPrepareOptionsMenu}for more information.
 * @param menu The options menu as last shown or first initialized byonCreateOptionsMenu().
 * @see #setHasOptionsMenu
 * @see #onCreateOptionsMenu
 */
@Override public void onPrepareOptionsMenu(Menu menu){
  menu.clear();
  menu.add(Menu.NONE,MENU_ITEM_SEARCH,Menu.NONE,getString(R.string.search)).setIcon(new IconDrawable(getActivity(),Iconify.IconValue.fa_search).colorRes(R.color.black).actionBarSize()).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
  menu.addSubMenu(Menu.NONE,MENU_ITEM_DATA_TABLES,Menu.NONE,Constants.DATA_TABLE_CLIENTS_NAME);
  menu.add(Menu.NONE,MENU_ITEM_DOCUMENTS,Menu.NONE,getString(R.string.documents));
  menu.add(Menu.NONE,MENU_ITEM_IDENTIFIERS,Menu.NONE,getString(R.string.identifiers));
  int SUBMENU_ITEM_ID=0;
  SubMenu dataTableSubMenu=menu.getItem(1).getSubMenu();
  if (dataTableSubMenu != null && clientDataTables != null && clientDataTables.size() > 0) {
    Iterator<DataTable> dataTableIterator=clientDataTables.iterator();
    while (dataTableIterator.hasNext()) {
      dataTableSubMenu.add(Menu.NONE,SUBMENU_ITEM_ID,Menu.NONE,dataTableIterator.next().getRegisteredTableName());
      SUBMENU_ITEM_ID++;
    }
  }
  super.onPrepareOptionsMenu(menu);
}