Buggy code:
public static final int NAVIGATE_TO = 1 ; public static final int DELETE_ITEM = 2 ; public static final int EDIT_ITEM = 3 ; public static final int EXPORT_ID = 0 ; public static final int IMPORT_ID = 1 ; public static final int DELETE_ID = 2 ; public static final String FILE_TO_SAVE = "favourites.gpx" ; private FavouritesActivity . FavouritesAdapter favouritesAdapter ; private FavouritesDbHelper helper ; private boolean selectionMode = false ; private Set < FavouritePoint > favoritesToDelete = new LinkedHashSet < FavouritePoint > ( ) ; private Set < String > groupsToDelete = new LinkedHashSet < String > ( ) ; @ Override public void onCreate ( Bundle icicle ) { } private void cancelSelectingMode ( ) { } private void deleteFavorites ( ) { } @ Override protected void onResume ( ) { } @ Override public boolean onChildClick ( ExpandableListView parent , View v , int groupPosition , int childPosition , long id ) { } @ SuppressWarnings ( "unchecked" ) @ Override public boolean onContextItemSelected ( MenuItem aItem ) { ContextMenuInfo menuInfo = aItem . getMenuInfo ( ) ; int child = ExpandableListView . getPackedPositionChild ( ( ( ExpandableListContextMenuInfo ) ( menuInfo ) ) . packedPosition ) ; int group = ExpandableListView . getPackedPositionGroup ( ( ( ExpandableListContextMenuInfo ) ( menuInfo ) ) . packedPosition ) ; final FavouritePoint point = ( ( FavouritePoint ) ( favouritesAdapter . getChild ( group , child ) ) ) ; if ( ( aItem . getItemId ( ) ) == ( FavouritesActivity . SHOW_ON_MAP ) ) { OsmandSettings settings = OsmandSettings . getOsmandSettings ( this ) ; settings . SHOW_FAVORITES . set ( true ) ; settings . setMapLocationToShow ( point . getLatitude ( ) , point . getLongitude ( ) , Math . max ( 12 , settings . getLastKnownMapZoom ( ) ) , null , ( ( ( getString ( favorite ) ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( point . getName ( ) ) ) ) ; MapActivity . launchMapActivityMoveToTop ( this ) ; } else if ( ( aItem . getItemId ( ) ) == ( FavouritesActivity . NAVIGATE_TO ) ) { OsmandSettings . getOsmandSettings ( this ) . setPointToNavigate ( point . getLatitude ( ) , point . getLongitude ( ) , ( ( ( getString ( favorite ) ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( point . getName ( ) ) ) ) ; MapActivity . launchMapActivityMoveToTop ( this ) ; } else if ( ( aItem . getItemId ( ) ) == ( FavouritesActivity . EDIT_ITEM ) ) { Builder builder = new AlertDialog . Builder ( this ) ; builder . setTitle ( favourites_context_menu_edit ) ; final View v = getLayoutInflater ( ) . inflate ( favourite_edit_dialog , getExpandableListView ( ) , false ) ; final AutoCompleteTextView cat = ( ( AutoCompleteTextView ) ( v . findViewById ( Category ) ) ) ; final EditText editText = ( ( EditText ) ( v . findViewById ( Name ) ) ) ; builder . setView ( v ) ; editText . setText ( point . getName ( ) ) ; cat . setText ( point . getCategory ( ) ) ; cat . setThreshold ( 1 ) ; cat . setAdapter ( new android . widget . ArrayAdapter ( this , layout . list_textview , helper . getFavoriteGroups ( ) . keySet ( ) . toArray ( ) ) ) ; builder . setNegativeButton ( default_buttons_cancel , null ) ; builder . setPositiveButton ( default_buttons_apply , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int which ) { boolean editied = helper . editFavouriteName ( point , editText . getText ( ) . toString ( ) , cat . getText ( ) . toString ( ) ) ; if ( editied ) { favouritesAdapter . synchronizeGroups ( ) ; } } } ) ; builder . create ( ) . show ( ) ; return true ; } if ( ( aItem . getItemId ( ) ) == ( FavouritesActivity . DELETE_ITEM ) ) { final Resources resources = this . getResources ( ) ; Builder builder = new AlertDialog . Builder ( this ) ; <START_BUG> builder . setMessage ( MessageFormat . format ( getString ( favourites_remove_dialog_msg , point . getName ( ) ) ) ) ; <END_BUG> builder . setNegativeButton ( default_buttons_no , null ) ; builder . setPositiveButton ( default_buttons_yes , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int which ) { boolean deleted = helper . deleteFavourite ( point ) ; if ( deleted ) { Toast . makeText ( FavouritesActivity . this , MessageFormat . format ( resources . getString ( favourites_remove_dialog_success ) , point . getName ( ) ) , LENGTH_SHORT ) . show ( ) ; favouritesAdapter . synchronizeGroups ( ) ; } } } ) ; builder . create ( ) . show ( ) ; return true ; } return false ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } public void showProgressBar ( ) { } public void hideProgressBar ( ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } class FavouritesAdapter extends BaseExpandableListAdapter { Map < String , List < FavouritePoint > > sourceFavoriteGroups ; Map < String , List < FavouritePoint > > favoriteGroups = new LinkedHashMap < String , List < FavouritePoint > > ( ) ; List < String > groups = new ArrayList < String > ( ) ; public void setFavoriteGroups ( Map < String , List < FavouritePoint > > favoriteGroups ) { } public void addFavoritePoint ( FavouritePoint p ) { } public void deleteFavoritePoint ( FavouritePoint p ) { } public void deleteCategory ( String p ) { } public void synchronizeGroups ( ) { } @ Override public FavouritePoint getChild ( int groupPosition , int childPosition ) { }

Fix:
builder . setMessage ( MessageFormat . format ( resources . getString ( favourites_remove_dialog_msg , point . getName ( ) ) ) ) ;