Program: 187847
Project: 187847
Buggy source:
/** 
 * Hook up buttons, lists, and edittext with functionality.
 */
private void createView(){
  mSpinnerListFilter=(Spinner)findViewById(R.id.spinner_listfilter);
  mSpinnerListFilter.setOnItemSelectedListener(new OnItemSelectedListener(){
    public void onItemSelected(    AdapterView parent,    View v,    int position,    long id){
      fillItems();
      mListItems.setListTheme(loadListTheme());
      bindGTalkIfNeeded();
    }
    public void onNothingSelected(    AdapterView arg0){
      fillItems();
    }
  }
);
  mEditText=(AutoCompleteTextView)findViewById(R.id.autocomplete_add_item);
  mItemsCursor=managedQuery(Items.CONTENT_URI,new String[]{Items._ID,Items.NAME},null,null,"String_Node_Str");
  SimpleCursorAdapter adapter=new SimpleCursorAdapter(this,android.R.layout.simple_dropdown_item_1line,mItemsCursor,new String[]{Items.NAME},new int[]{android.R.id.text1});
  adapter.setStringConversionColumn(1);
  adapter.setFilterQueryProvider(new FilterQueryProvider(){
    public Cursor runQuery(    CharSequence constraint){
      mItemsCursor=managedQuery(Items.CONTENT_URI,new String[]{Items._ID,Items.NAME},"String_Node_Str" + (constraint == null ? "String_Node_Str" : constraint.toString().toUpperCase()) + "String_Node_Str",null,"String_Node_Str");
      return mItemsCursor;
    }
  }
);
  mEditText.setAdapter(adapter);
  mEditText.setOnKeyListener(new OnKeyListener(){
    public boolean onKey(    View v,    int keyCode,    KeyEvent key){
      Log.i(TAG,"String_Node_Str" + key.getAction());
      Log.i(TAG,"String_Node_Str" + keyCode);
      if (key.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_ENTER) {
        insertNewItem();
        return true;
      }
      ;
      return false;
    }
  }
);
  Button button=(Button)findViewById(R.id.button_add_item);
  button.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      insertNewItem();
    }
  }
);
  mLayoutParamsItems=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  mListItems=(ShoppingListView)findViewById(R.id.list_items);
  mListItems.setThemedBackground(findViewById(R.id.background));
  mListItems.setOnItemClickListener(new OnItemClickListener(){
    public void onItemClick(    AdapterView parent,    View v,    int pos,    long id){
      Cursor c=(Cursor)parent.getItemAtPosition(pos);
      if (mState == STATE_PICK_ITEM) {
        pickItem(c);
      }
 else {
        mListItems.toggleItemBought(pos);
      }
    }
  }
);
  mListItems.setOnCreateContextMenuListener(new View.OnCreateContextMenuListener(){
    public void onCreateContextMenu(    ContextMenu contextmenu,    View view,    ContextMenuInfo info){
      contextmenu.add(0,MENU_MARK_ITEM,0,R.string.menu_mark_item).setShortcut('1','m');
      contextmenu.add(0,MENU_EDIT_ITEM,0,R.string.menu_edit_item).setShortcut('2','e');
      contextmenu.add(0,MENU_REMOVE_ITEM_FROM_LIST,0,R.string.menu_remove_item).setShortcut('3','r');
      contextmenu.add(0,MENU_DELETE_ITEM,0,R.string.menu_delete_item).setShortcut('4','d');
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Hook up buttons, lists, and edittext with functionality.
 */
private void createView(){
  mSpinnerListFilter=(Spinner)findViewById(R.id.spinner_listfilter);
  mSpinnerListFilter.setOnItemSelectedListener(new OnItemSelectedListener(){
    public void onItemSelected(    AdapterView parent,    View v,    int position,    long id){
      Log.d(TAG,"String_Node_Str");
      fillItems();
      mListItems.setListTheme(loadListTheme());
      bindGTalkIfNeeded();
    }
    public void onNothingSelected(    AdapterView arg0){
      Log.d(TAG,"String_Node_Str");
      fillItems();
    }
  }
);
  mEditText=(AutoCompleteTextView)findViewById(R.id.autocomplete_add_item);
  mItemsCursor=managedQuery(Items.CONTENT_URI,new String[]{Items._ID,Items.NAME},null,null,"String_Node_Str");
  SimpleCursorAdapter adapter=new SimpleCursorAdapter(this,android.R.layout.simple_dropdown_item_1line,mItemsCursor,new String[]{Items.NAME},new int[]{android.R.id.text1});
  adapter.setStringConversionColumn(1);
  adapter.setFilterQueryProvider(new FilterQueryProvider(){
    public Cursor runQuery(    CharSequence constraint){
      mItemsCursor=managedQuery(Items.CONTENT_URI,new String[]{Items._ID,Items.NAME},"String_Node_Str" + (constraint == null ? "String_Node_Str" : constraint.toString().toUpperCase()) + "String_Node_Str",null,"String_Node_Str");
      return mItemsCursor;
    }
  }
);
  mEditText.setAdapter(adapter);
  mEditText.setOnKeyListener(new OnKeyListener(){
    public boolean onKey(    View v,    int keyCode,    KeyEvent key){
      Log.i(TAG,"String_Node_Str" + key.getAction());
      Log.i(TAG,"String_Node_Str" + keyCode);
      if (key.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_ENTER) {
        insertNewItem();
        return true;
      }
      ;
      return false;
    }
  }
);
  Button button=(Button)findViewById(R.id.button_add_item);
  button.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      insertNewItem();
    }
  }
);
  mLayoutParamsItems=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  mListItems=(ShoppingListView)findViewById(R.id.list_items);
  mListItems.setThemedBackground(findViewById(R.id.background));
  mListItems.setOnItemClickListener(new OnItemClickListener(){
    public void onItemClick(    AdapterView parent,    View v,    int pos,    long id){
      Cursor c=(Cursor)parent.getItemAtPosition(pos);
      if (mState == STATE_PICK_ITEM) {
        pickItem(c);
      }
 else {
        mListItems.toggleItemBought(pos);
      }
    }
  }
);
  mListItems.setOnCreateContextMenuListener(new View.OnCreateContextMenuListener(){
    public void onCreateContextMenu(    ContextMenu contextmenu,    View view,    ContextMenuInfo info){
      contextmenu.add(0,MENU_MARK_ITEM,0,R.string.menu_mark_item).setShortcut('1','m');
      contextmenu.add(0,MENU_EDIT_ITEM,0,R.string.menu_edit_item).setShortcut('2','e');
      contextmenu.add(0,MENU_REMOVE_ITEM_FROM_LIST,0,R.string.menu_remove_item).setShortcut('3','r');
      contextmenu.add(0,MENU_DELETE_ITEM,0,R.string.menu_delete_item).setShortcut('4','d');
    }
  }
);
}