Buggy code:
public class LibraryActivity extends RoboListActivity implements OnItemSelectedListener { @ Inject private LibraryService libraryService ; private LibraryActivity . BookAdapter bookAdapter ; private ArrayAdapter < String > menuAdapter ; private static final DateFormat DATE_FORMAT = DateFormat . getDateInstance ( DateFormat . LONG , Locale . ENGLISH ) ; private ProgressDialog waitDialog ; private ProgressDialog importDialog ; @ InjectResource ( drawable . river_diary ) private Drawable backupCover ; private int lastPosition ; private static final String [ ] MENU_ITEMS = new String [ ] { "Most<seq2seq4repair_space>recently<seq2seq4repair_space>read<seq2seq4repair_space>books" , "Most<seq2seq4repair_space>recently<seq2seq4repair_space>added<seq2seq4repair_space>books" , "Unread<seq2seq4repair_space>books" , "All<seq2seq4repair_space>books<seq2seq4repair_space>by<seq2seq4repair_space>title" , "All<seq2seq4repair_space>books<seq2seq4repair_space>by<seq2seq4repair_space>author" } ; private static final Logger LOG = LoggerFactory . getLogger ( LibraryActivity . class ) ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public void onItemSelected ( AdapterView < ? > parent , View view , int pos , long id ) { } @ Override public void onCreateContextMenu ( ContextMenu menu , View v , ContextMenuInfo menuInfo ) { if ( ( this . getListAdapter ( ) ) == ( this . menuAdapter ) ) { return ; } AdapterContextMenuInfo info = ( ( AdapterContextMenuInfo ) ( menuInfo ) ) ; final LibraryBook selectedBook = bookAdapter . getResultAt ( info . position ) ; MenuItem detailsItem = menu . add ( "View<seq2seq4repair_space>details" ) ; detailsItem . setOnMenuItemClickListener ( new OnMenuItemClickListener ( ) { @ Override public boolean onMenuItemClick ( MenuItem item ) { Intent intent = new Intent ( LibraryActivity . this , BookDetailsActivity . class ) ; <START_BUG> intent . putExtra ( "book" , selectedBook ) ; <END_BUG> startActivity ( intent ) ; return true ; } } ) ; MenuItem deleteItem = menu . add ( "Delete<seq2seq4repair_space>from<seq2seq4repair_space>library" ) ; deleteItem . setOnMenuItemClickListener ( new OnMenuItemClickListener ( ) { @ Override public boolean onMenuItemClick ( MenuItem item ) { libraryService . deleteBook ( selectedBook . getFileName ( ) ) ; new LibraryActivity . LoadBooksTask ( ) . execute ( lastPosition ) ; return true ; } } ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onMenuItemSelected ( int featureId , MenuItem item ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override protected void onStop ( ) { } @ Override public void onNothingSelected ( AdapterView < ? > arg0 ) { } @ Override public void onBackPressed ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onResume ( ) { } private class BookAdapter extends QueryResultAdapter < LibraryBook > { private Context context ; public BookAdapter ( Context context ) { } @ Override public View getView ( int index , LibraryBook book , View convertView , ViewGroup parent ) { } } @ Override protected void onListItemClick ( ListView l , View v , int position , long id ) { } private void handleMenuClick ( int position ) { } private class ImportBooksTask extends AsyncTask < File , Integer , Void > { private boolean hadError = false ; private static final int UPDATE_FOLDER = 1 ; private static final int UPDATE_IMPORT = 2 ; private int foldersScanned = 0 ; private boolean oldKeepScreenOn ; @ Override protected void onPreExecute ( ) { } @ Override protected Void doInBackground ( File ... params ) { } private void findEpubsInFolder ( File folder , List < File > items ) { } private void importBook ( String file ) { } @ Override protected void onProgressUpdate ( Integer ... values ) { } @ Override protected void onPostExecute ( Void result ) { } } private class LoadBooksTask extends AsyncTask < Integer , Integer , QueryResult < LibraryBook > > { @ Override protected void onPreExecute ( ) { } @ Override protected QueryResult < LibraryBook > doInBackground ( Integer ... params ) { } @ Override protected void onPostExecute ( QueryResult < LibraryBook > result ) { } } }

Fix:
intent . putExtra ( "book" , selectedBook . getFileName ( ) ) ;