Source:
<code>public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); if (!isAdded() || getPageActivity().isSearching()) { return; <START> } <END> MenuItem menuItemSavePage = menu.findItem(R.id.menu_save_page); if (menuItemSavePage == null) { return; } MenuItem menuItemShare = menu.findItem(R.id.menu_share_page); MenuItem menuItemOtherLang = menu.findItem(R.id.menu_other_languages); MenuItem menuItemFindInPage = menu.findItem(R.id.menu_find_in_page); MenuItem menuItemThemeChooser = menu.findItem(R.id.menu_themechooser); if (pageLoadStrategy.isLoading()) { menuItemSavePage.setEnabled(false); menuItemShare.setEnabled(false); menuItemOtherLang.setEnabled(false); menuItemFindInPage.setEnabled(false); menuItemThemeChooser.setEnabled(false); } else { menuItemSavePage.setEnabled(true); menuItemShare.setEnabled(true); menuItemOtherLang.setVisible(model.getPage() != null && model.getPage().getPageProperties().getLanguageCount() != 0); menuItemOtherLang.setEnabled(true); menuItemFindInPage.setEnabled(true); menuItemThemeChooser.setEnabled(true); int subState = pageLoadStrategy.getSubState(); if (subState == SUBSTATE_PAGE_SAVED) { menuItemSavePage.setEnabled(false); menuItemSavePage.setTitle(WikipediaApp.getInstance().getString(R.string.menu_page_saved)); } else if (subState == SUBSTATE_SAVED_PAGE_LOADED) { menuItemSavePage.setTitle(WikipediaApp.getInstance().getString(R.string.menu_refresh_saved_page)); } else { menuItemSavePage.setTitle(WikipediaApp.getInstance().getString(R.string.menu_save_page)); } } }</code><technical_language>This is a fine change. locals require names sense in a larger scope, consider calling items menu items. Additionally, this is a small space lots of variables of kind, consider moving item end a reader sees is important. In this case, *share*Item, *savePage*Item, etc. in a method called onPrepareOptionsMenu() some tie menu, if working menu items are, chances a menu item I need item is</technical_language>

Target:
public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); if (!isAdded() || getPageActivity().isSearching()) { return; } MenuItem savePageItem = menu.findItem(R.id.menu_save_page); if (savePageItem == null) { return; } MenuItem shareItem = menu.findItem(R.id.menu_share_page); MenuItem otherLangItem = menu.findItem(R.id.menu_other_languages); MenuItem findInPageItem = menu.findItem(R.id.menu_find_in_page); MenuItem themeChooserItem = menu.findItem(R.id.menu_themechooser); if (pageLoadStrategy.isLoading()) { savePageItem.setEnabled(false); shareItem.setEnabled(false); otherLangItem.setEnabled(false); findInPageItem.setEnabled(false); themeChooserItem.setEnabled(false); } else { savePageItem.setEnabled(true); shareItem.setEnabled(true); otherLangItem.setVisible(model.getPage() != null && model.getPage().getPageProperties().getLanguageCount() != 0); otherLangItem.setEnabled(true); findInPageItem.setEnabled(true); themeChooserItem.setEnabled(true); int subState = pageLoadStrategy.getSubState(); if (subState == SUBSTATE_PAGE_SAVED) { savePageItem.setEnabled(false); savePageItem.setTitle(WikipediaApp.getInstance().getString(R.string.menu_page_saved)); } else if (subState == SUBSTATE_SAVED_PAGE_LOADED) { savePageItem.setTitle(WikipediaApp.getInstance().getString(R.string.menu_refresh_saved_page)); } else { savePageItem.setTitle(WikipediaApp.getInstance().getString(R.string.menu_save_page)); } } }