Program: 187887
Project: 187887
Buggy source:
/** 
 * Called when the activity is first created.
 */
@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  Log.i(TAG,"String_Node_Str");
  if (!EulaActivity.checkEula(this)) {
    return;
  }
  setContentView(R.layout.shopping);
  Shopping.mContentResolver=getContentResolver();
  mGTalkSender=new GTalkSender(this);
  mUpdateInterval=2000;
  mUpdating=false;
  mListUri=Shopping.Lists.CONTENT_URI;
  mItemUri=Shopping.Items.CONTENT_URI;
  int defaultShoppingList=(int)Shopping.getDefaultList();
  final Intent intent=getIntent();
  final String type=intent.resolveType(this);
  final String action=intent.getAction();
  if (action == null) {
    mState=STATE_MAIN;
    mListUri=Uri.withAppendedPath(Shopping.Lists.CONTENT_URI,"String_Node_Str" + defaultShoppingList);
    intent.setData(mListUri);
  }
 else   if (Intent.ACTION_MAIN.equals(action)) {
    mState=STATE_MAIN;
    mListUri=Uri.withAppendedPath(Shopping.Lists.CONTENT_URI,"String_Node_Str" + defaultShoppingList);
    intent.setData(mListUri);
  }
 else   if (Intent.ACTION_VIEW.equals(action)) {
    mState=STATE_VIEW_LIST;
    if (Shopping.ITEM_TYPE.equals(type)) {
      mListUri=Shopping.getListForItem(intent.getData().getLastPathSegment());
    }
 else {
      mListUri=intent.getData();
    }
  }
 else   if (Intent.ACTION_PICK.equals(action)) {
    mState=STATE_PICK_ITEM;
    mListUri=Uri.withAppendedPath(Shopping.Lists.CONTENT_URI,"String_Node_Str" + defaultShoppingList);
  }
 else   if (Intent.ACTION_GET_CONTENT.equals(action)) {
    mState=STATE_GET_CONTENT_ITEM;
    mListUri=Uri.withAppendedPath(Shopping.Lists.CONTENT_URI,"String_Node_Str" + defaultShoppingList);
  }
 else {
    Log.e(TAG,"String_Node_Str");
    finish();
    return;
  }
  mTypefaceHandwriting=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  mTypefaceDigital=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  mTypeface=null;
  mTypeface=mTypefaceHandwriting;
  createView();
  setListTheme(1);
  fillListFilter();
  int selectList;
  try {
    selectList=Integer.parseInt(mListUri.getLastPathSegment());
  }
 catch (  NumberFormatException e) {
    selectList=defaultShoppingList;
  }
  setSelectedListId(selectList);
  fillItems();
  setListTheme(loadListTheme());
  bindGTalkIfNeeded();
  if (icicle != null) {
    String prevText=icicle.getString(ORIGINAL_ITEM);
    if (prevText != null) {
      mEditText.setText(prevText);
    }
  }
  mEditText.requestFocus();
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created.
 */
@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  Log.i(TAG,"String_Node_Str");
  if (!EulaActivity.checkEula(this)) {
    return;
  }
  setContentView(R.layout.shopping);
  Shopping.mContentResolver=getContentResolver();
  mGTalkSender=new GTalkSender(this);
  mUpdateInterval=2000;
  mUpdating=false;
  mListUri=Shopping.Lists.CONTENT_URI;
  mItemUri=Shopping.Items.CONTENT_URI;
  int defaultShoppingList=(int)Shopping.getDefaultList();
  final Intent intent=getIntent();
  final String type=intent.resolveType(this);
  final String action=intent.getAction();
  if (action == null) {
    mState=STATE_MAIN;
    mListUri=Uri.withAppendedPath(Shopping.Lists.CONTENT_URI,"String_Node_Str" + defaultShoppingList);
    intent.setData(mListUri);
  }
 else   if (Intent.ACTION_MAIN.equals(action)) {
    mState=STATE_MAIN;
    mListUri=Uri.withAppendedPath(Shopping.Lists.CONTENT_URI,"String_Node_Str" + defaultShoppingList);
    intent.setData(mListUri);
  }
 else   if (Intent.ACTION_VIEW.equals(action)) {
    mState=STATE_VIEW_LIST;
    if (Shopping.ITEM_TYPE.equals(type)) {
      mListUri=Shopping.getListForItem(intent.getData().getLastPathSegment());
    }
 else     if (intent.getData() != null) {
      mListUri=intent.getData();
    }
  }
 else   if (Intent.ACTION_PICK.equals(action)) {
    mState=STATE_PICK_ITEM;
    mListUri=Uri.withAppendedPath(Shopping.Lists.CONTENT_URI,"String_Node_Str" + defaultShoppingList);
  }
 else   if (Intent.ACTION_GET_CONTENT.equals(action)) {
    mState=STATE_GET_CONTENT_ITEM;
    mListUri=Uri.withAppendedPath(Shopping.Lists.CONTENT_URI,"String_Node_Str" + defaultShoppingList);
  }
 else {
    Log.e(TAG,"String_Node_Str");
    finish();
    return;
  }
  mTypefaceHandwriting=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  mTypefaceDigital=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  mTypeface=null;
  mTypeface=mTypefaceHandwriting;
  createView();
  setListTheme(1);
  fillListFilter();
  int selectList;
  try {
    selectList=Integer.parseInt(mListUri.getLastPathSegment());
  }
 catch (  NumberFormatException e) {
    selectList=defaultShoppingList;
  }
  setSelectedListId(selectList);
  fillItems();
  setListTheme(loadListTheme());
  bindGTalkIfNeeded();
  if (icicle != null) {
    String prevText=icicle.getString(ORIGINAL_ITEM);
    if (prevText != null) {
      mEditText.setText(prevText);
    }
  }
  mEditText.requestFocus();
}