Program: 33022
Project: 33022
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_LOAN_NAME);
  menu.add(Menu.NONE,MENU_ITEM_LOAN_TRANSACTIONS,Menu.NONE,getResources().getString(R.string.transactions));
  menu.add(Menu.NONE,MENU_ITEM_REPAYMENT_SCHEDULE,Menu.NONE,getResources().getString(R.string.loan_repayment_schedule));
  menu.add(Menu.NONE,MENU_ITEM_DOCUMENTS,Menu.NONE,getResources().getString(R.string.documents));
  int SUBMENU_ITEM_ID=0;
  SubMenu dataTableSubMenu=menu.getItem(0).getSubMenu();
  if (dataTableSubMenu != null && loanDataTables != null && loanDataTables.size() > 0) {
    Iterator<DataTable> dataTableIterator=loanDataTables.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_LOAN_NAME);
  menu.add(Menu.NONE,MENU_ITEM_LOAN_TRANSACTIONS,Menu.NONE,getResources().getString(R.string.transactions));
  menu.add(Menu.NONE,MENU_ITEM_REPAYMENT_SCHEDULE,Menu.NONE,getResources().getString(R.string.loan_repayment_schedule));
  menu.add(Menu.NONE,MENU_ITEM_DOCUMENTS,Menu.NONE,getResources().getString(R.string.documents));
  int SUBMENU_ITEM_ID=0;
  SubMenu dataTableSubMenu=menu.getItem(1).getSubMenu();
  if (dataTableSubMenu != null && loanDataTables != null && loanDataTables.size() > 0) {
    Iterator<DataTable> dataTableIterator=loanDataTables.iterator();
    while (dataTableIterator.hasNext()) {
      dataTableSubMenu.add(Menu.NONE,SUBMENU_ITEM_ID,Menu.NONE,dataTableIterator.next().getRegisteredTableName());
      SUBMENU_ITEM_ID++;
    }
  }
  super.onPrepareOptionsMenu(menu);
}