Buggy code:
public class OutlineActivity extends ListActivity { private static final int SYNC_OPTION = 0 ; private static final int SETTINGS_OPTION = 1 ; private static final int CAPTURE_OPTION = 2 ; private static final int WEBSITE_OPTION = 3 ; public class HashMapAdapter extends BaseAdapter { private LinkedHashMap < String , String > mData = new LinkedHashMap < String , String > ( ) ; private OutlineActivity mAct ; private String [ ] mKeys ; private LayoutInflater mInflater ; public HashMapAdapter ( LinkedHashMap < String , String > data , OutlineActivity act ) { } @ Override public int getCount ( ) { } @ Override public Object getItem ( int position ) { } @ Override public long getItemId ( int arg0 ) { } @ Override public View getView ( int pos , View convertView , ViewGroup parent ) { } } private static final int NEW_USER_DIALOG = 0 ; private static final int UPGRADE_DIALOG = 1 ; private MobileOrgApplication appInst ; private long node_id ; private int lastSelection = 0 ; private OutlineCursorAdapter outlineAdapter ; private OutlineActivity . SynchServiceReceiver syncReceiver ; private boolean emptylist = false ; @ Override public void onCreate ( Bundle savedInstanceState ) { } private void showUpgradePopup ( ) { } private String getRawContents ( int resource ) { } private boolean checkNewInstallation ( ) { } private boolean checkVersionCode ( ) { } public static void setupActionbar ( Activity activity ) { } @ Override public void onDestroy ( ) { } private void refreshDisplay ( ) { Cursor cursor ; if ( ( node_id ) >= 0 ) { cursor = appInst . getDB ( ) . getNodeChildren ( node_id ) ; if ( ( cursor . getCount ( ) ) == 0 ) finish ( ) ; } else cursor = appInst . getDB ( ) . getFileCursor ( ) ; <START_BUG> if ( cursor == null ) { <END_BUG> emptylist = true ; LinkedHashMap < String , String > lhm = new LinkedHashMap < String , String > ( ) ; lhm . put ( "Synchronize" , "Fetch<seq2seq4repair_space>your<seq2seq4repair_space>org<seq2seq4repair_space>data" ) ; lhm . put ( "Settings" , "Configure<seq2seq4repair_space>MobileOrg" ) ; lhm . put ( "Capture" , "Capture<seq2seq4repair_space>a<seq2seq4repair_space>new<seq2seq4repair_space>note" ) ; lhm . put ( "Website" , "Visit<seq2seq4repair_space>the<seq2seq4repair_space>MobileOrg<seq2seq4repair_space>Wiki" ) ; setListAdapter ( new OutlineActivity . HashMapAdapter ( lhm , this ) ) ; } else { emptylist = false ; startManagingCursor ( cursor ) ; this . outlineAdapter = new OutlineCursorAdapter ( this , cursor , appInst . getDB ( ) ) ; this . setListAdapter ( outlineAdapter ) ; getListView ( ) . setSelection ( this . lastSelection ) ; } } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onCreateContextMenu ( ContextMenu menu , View v , ContextMenuInfo menuInfo ) { } @ Override public boolean onContextItemSelected ( MenuItem item ) { } @ Override public void onListItemClick ( ListView l , View v , int position , long id ) { } private void showWizard ( ) { } protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } private void runHelp ( ) { } private void runSync ( ) { } private boolean runEditNewNodeActivity ( ) { } private void runEditNodeActivity ( long nodeId ) { } private void runViewNodeActivity ( long nodeId ) { } private void runExpandSelection ( long id ) { } private void runDeleteFileNode ( final long node_id ) { } private void runDeleteNode ( final long node_id ) { } private boolean runSearch ( ) { } private boolean runShowSettings ( ) { } private class SynchServiceReceiver extends BroadcastReceiver { @ Override public void onReceive ( Context context , Intent intent ) { } } }

Fix:
if ( ( cursor == null ) || ( ( cursor . getCount ( ) ) < 1 ) ) {