Program: 187927
Project: 187927
Buggy source:
/** 
 * Updates information about an item in a list. If the item does not exist yet, it is created. Update could include to strike an item through.
 * @param bundle
 */
void updateItem(Bundle bundle){
  if (bundle != null) {
    String shareListName=bundle.getString(Shopping.Lists.SHARE_NAME);
    String itemNameOld=bundle.getString(Shopping.Items.NAME + GTalkSender.OLD);
    String itemName=bundle.getString(Shopping.Items.NAME);
    String itemStatusOld=bundle.getString(Shopping.Contains.STATUS + GTalkSender.OLD);
    String itemStatus=bundle.getString(Shopping.Contains.STATUS);
    String itemSender=bundle.getString(GTalkSender.SENDER);
    if (shareListName == null) {
      Log.e(TAG,"String_Node_Str");
      return;
    }
    if (itemName == null) {
      Log.e(TAG,"String_Node_Str");
      return;
    }
    if (itemNameOld == null || itemStatusOld == null || itemStatus == null || itemSender == null) {
      Log.e(TAG,"String_Node_Str");
      return;
    }
    Cursor c=mContentResolver.query(Shopping.Lists.CONTENT_URI,mProjectionLists,Shopping.Lists.SHARE_NAME + "String_Node_Str" + shareListName+ "String_Node_Str",null,Shopping.Lists.DEFAULT_SORT_ORDER);
    if (c == null || c.count() < 1) {
      Log.i(TAG,"String_Node_Str");
    }
 else {
      c.first();
      long listId=c.getLong(mProjectionListsID);
      Cursor citem=mContentResolver.query(Shopping.ContainsFull.CONTENT_URI,mProjectionContainsFull,Shopping.ContainsFull.LIST_ID + "String_Node_Str" + listId+ "String_Node_Str"+ "String_Node_Str"+ Shopping.ContainsFull.ITEM_NAME+ "String_Node_Str"+ itemNameOld+ "String_Node_Str"+ "String_Node_Str"+ Shopping.ContainsFull.STATUS+ "String_Node_Str"+ itemStatusOld+ "String_Node_Str",null,null);
      if (citem == null || citem.count() < 1) {
        citem=mContentResolver.query(Shopping.ContainsFull.CONTENT_URI,mProjectionContainsFull,Shopping.ContainsFull.LIST_ID + "String_Node_Str" + listId+ "String_Node_Str"+ "String_Node_Str"+ Shopping.ContainsFull.ITEM_NAME+ "String_Node_Str"+ itemNameOld+ "String_Node_Str",null,null);
      }
      if (citem == null || citem.count() < 1) {
        Log.i(TAG,"String_Node_Str");
        long itemId=Shopping.getItem(itemName);
        ContentValues values=new ContentValues(2);
        values.put(Contains.ITEM_ID,itemId);
        values.put(Contains.LIST_ID,listId);
        values.put(Contains.STATUS,Long.parseLong(itemStatus));
        values.put(Contains.SHARE_MODIFIED_BY,itemSender);
        try {
          Uri uri=mContentResolver.insert(Contains.CONTENT_URI,values);
          Log.i(TAG,"String_Node_Str" + uri);
        }
 catch (        Exception e) {
          Log.i(TAG,"String_Node_Str",e);
        }
      }
 else {
        citem.first();
        long itemId=citem.getLong(mProjectionContainsFullITEMID);
        long containsId=citem.getLong(mProjectionContainsFullCONTAINSID);
        Uri itemUri=Uri.withAppendedPath(Shopping.Items.CONTENT_URI,"String_Node_Str" + itemId);
        ContentValues values=new ContentValues(1);
        values.put(Shopping.Items.NAME,itemName);
        mContentResolver.update(itemUri,values,null,null);
        Uri containsUri=Uri.withAppendedPath(Shopping.Contains.CONTENT_URI,"String_Node_Str" + containsId);
        values=new ContentValues(2);
        values.put(Shopping.Contains.STATUS,Long.parseLong(itemStatus));
        values.put(Shopping.Contains.SHARE_MODIFIED_BY,itemSender);
        mContentResolver.update(containsUri,values,null,null);
      }
    }
    mContext.broadcastIntent(new Intent(OpenIntents.REFRESH_ACTION));
  }
 else {
    Log.e(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Updates information about an item in a list. If the item does not exist yet, it is created. Update could include to strike an item through.
 * @param bundle
 */
void updateItem(Bundle bundle){
  if (bundle != null) {
    String shareListName=bundle.getString(Shopping.Lists.SHARE_NAME);
    String itemNameOld=bundle.getString(Shopping.Items.NAME + GTalkSender.OLD);
    String itemName=bundle.getString(Shopping.Items.NAME);
    String itemStatusOld=bundle.getString(Shopping.Contains.STATUS + GTalkSender.OLD);
    String itemStatus=bundle.getString(Shopping.Contains.STATUS);
    String itemSender=bundle.getString(GTalkSender.SENDER);
    if (shareListName == null) {
      Log.e(TAG,"String_Node_Str");
      return;
    }
    if (itemName == null) {
      Log.e(TAG,"String_Node_Str");
      return;
    }
    if (itemNameOld == null || itemStatusOld == null || itemStatus == null || itemSender == null) {
      Log.e(TAG,"String_Node_Str");
      return;
    }
    Cursor c=mContentResolver.query(Shopping.Lists.CONTENT_URI,mProjectionLists,Shopping.Lists.SHARE_NAME + "String_Node_Str" + shareListName+ "String_Node_Str",null,Shopping.Lists.DEFAULT_SORT_ORDER);
    if (c == null || c.count() < 1) {
      Log.i(TAG,"String_Node_Str");
    }
 else {
      c.first();
      long listId=c.getLong(mProjectionListsID);
      Log.i(TAG,"String_Node_Str" + itemNameOld + "String_Node_Str"+ itemStatusOld);
      Cursor citem=mContentResolver.query(Shopping.ContainsFull.CONTENT_URI,mProjectionContainsFull,Shopping.ContainsFull.LIST_ID + "String_Node_Str" + listId+ "String_Node_Str"+ "String_Node_Str"+ Shopping.ContainsFull.ITEM_NAME+ "String_Node_Str"+ itemNameOld+ "String_Node_Str"+ "String_Node_Str"+ Shopping.ContainsFull.STATUS+ "String_Node_Str"+ itemStatusOld+ "String_Node_Str",null,null);
      if (citem == null || citem.count() < 1) {
        Log.i(TAG,"String_Node_Str" + itemNameOld);
        citem=mContentResolver.query(Shopping.ContainsFull.CONTENT_URI,mProjectionContainsFull,Shopping.ContainsFull.LIST_ID + "String_Node_Str" + listId+ "String_Node_Str"+ "String_Node_Str"+ Shopping.ContainsFull.ITEM_NAME+ "String_Node_Str"+ itemNameOld+ "String_Node_Str",null,null);
      }
      if (citem == null || citem.count() < 1) {
        Log.i(TAG,"String_Node_Str");
        long itemId=Shopping.getItem(itemName);
        ContentValues values=new ContentValues(2);
        values.put(Contains.ITEM_ID,itemId);
        values.put(Contains.LIST_ID,listId);
        values.put(Contains.STATUS,Long.parseLong(itemStatus));
        values.put(Contains.SHARE_MODIFIED_BY,itemSender);
        try {
          Uri uri=mContentResolver.insert(Contains.CONTENT_URI,values);
          Log.i(TAG,"String_Node_Str" + uri);
        }
 catch (        Exception e) {
          Log.i(TAG,"String_Node_Str",e);
        }
      }
 else {
        citem.first();
        long itemId=citem.getLong(mProjectionContainsFullITEMID);
        long containsId=citem.getLong(mProjectionContainsFullCONTAINSID);
        Uri itemUri=Uri.withAppendedPath(Shopping.Items.CONTENT_URI,"String_Node_Str" + itemId);
        ContentValues values=new ContentValues(1);
        values.put(Shopping.Items.NAME,itemName);
        mContentResolver.update(itemUri,values,null,null);
        Uri containsUri=Uri.withAppendedPath(Shopping.Contains.CONTENT_URI,"String_Node_Str" + containsId);
        values=new ContentValues(2);
        values.put(Shopping.Contains.STATUS,Long.parseLong(itemStatus));
        values.put(Shopping.Contains.SHARE_MODIFIED_BY,itemSender);
        mContentResolver.update(containsUri,values,null,null);
      }
    }
    mContext.broadcastIntent(new Intent(OpenIntents.REFRESH_ACTION));
  }
 else {
    Log.e(TAG,"String_Node_Str");
  }
}