Program: 184006
Project: 184006
Buggy source:
void startQuery(){
  mAdapter.setLoading(true);
  mQueryHandler.cancelOperation(QUERY_TOKEN);
  mQueryHandler.setLoadingJoinSuggestions(false);
  String[] projection=getProjectionForQuery();
  String callingPackage=getCallingPackage();
  Uri uri=getUriToQuery();
  if (!TextUtils.isEmpty(callingPackage)) {
    uri=uri.buildUpon().appendQueryParameter(ContactsContract.REQUESTING_PACKAGE_PARAM_KEY,callingPackage).build();
  }
switch (mMode) {
case MODE_GROUP:
    mQueryHandler.startQuery(QUERY_TOKEN,null,mGroupUri,projection,getContactSelection(),null,getSortOrder(projection));
  break;
case MODE_DEFAULT:
case MODE_PICK_CONTACT:
case MODE_PICK_OR_CREATE_CONTACT:
case MODE_INSERT_OR_EDIT_CONTACT:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,getContactSelection(),null,getSortOrder(projection));
break;
case MODE_LEGACY_PICK_PERSON:
case MODE_LEGACY_PICK_OR_CREATE_PERSON:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,getSortOrder(projection));
break;
case MODE_QUERY:
{
mQuery=getIntent().getStringExtra(SearchManager.QUERY);
mQueryHandler.startQuery(QUERY_TOKEN,null,getContactFilterUri(mQuery),projection,null,null,getSortOrder(projection));
break;
}
case MODE_QUERY_PICK_TO_VIEW:
{
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,getSortOrder(projection));
break;
}
case MODE_STARRED:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,Contacts.STARRED + "String_Node_Str",null,getSortOrder(projection));
break;
case MODE_FREQUENT:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,Contacts.TIMES_CONTACTED + "String_Node_Str",null,Contacts.TIMES_CONTACTED + "String_Node_Str" + getSortOrder(projection));
break;
case MODE_STREQUENT:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,null);
break;
case MODE_PICK_PHONE:
case MODE_LEGACY_PICK_PHONE:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,getSortOrder(projection));
break;
case MODE_PICK_POSTAL:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,getSortOrder(projection));
break;
case MODE_LEGACY_PICK_POSTAL:
mQueryHandler.startQuery(QUERY_TOKEN,null,getUriToQuery(),projection,ContactMethods.KIND + "String_Node_Str" + android.provider.Contacts.KIND_POSTAL,null,getSortOrder(projection));
break;
case MODE_JOIN_CONTACT:
mQueryHandler.setLoadingJoinSuggestions(true);
mQueryHandler.startQuery(QUERY_TOKEN,null,getJoinSuggestionsUri(null),projection,null,null,null);
break;
}
}

Fixed version (ground truth):
void startQuery(){
  mAdapter.setLoading(true);
  mQueryHandler.cancelOperation(QUERY_TOKEN);
  mQueryHandler.setLoadingJoinSuggestions(false);
  String[] projection=getProjectionForQuery();
  String callingPackage=getCallingPackage();
  Uri uri=getUriToQuery();
  if (!TextUtils.isEmpty(callingPackage)) {
    uri=uri.buildUpon().appendQueryParameter(ContactsContract.REQUESTING_PACKAGE_PARAM_KEY,callingPackage).build();
  }
switch (mMode) {
case MODE_GROUP:
    mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,getContactSelection(),null,getSortOrder(projection));
  break;
case MODE_DEFAULT:
case MODE_PICK_CONTACT:
case MODE_PICK_OR_CREATE_CONTACT:
case MODE_INSERT_OR_EDIT_CONTACT:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,getContactSelection(),null,getSortOrder(projection));
break;
case MODE_LEGACY_PICK_PERSON:
case MODE_LEGACY_PICK_OR_CREATE_PERSON:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,getSortOrder(projection));
break;
case MODE_QUERY:
{
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,getSortOrder(projection));
break;
}
case MODE_QUERY_PICK_TO_VIEW:
{
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,getSortOrder(projection));
break;
}
case MODE_STARRED:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,Contacts.STARRED + "String_Node_Str",null,getSortOrder(projection));
break;
case MODE_FREQUENT:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,Contacts.TIMES_CONTACTED + "String_Node_Str",null,Contacts.TIMES_CONTACTED + "String_Node_Str" + getSortOrder(projection));
break;
case MODE_STREQUENT:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,null);
break;
case MODE_PICK_PHONE:
case MODE_LEGACY_PICK_PHONE:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,getSortOrder(projection));
break;
case MODE_PICK_POSTAL:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,getSortOrder(projection));
break;
case MODE_LEGACY_PICK_POSTAL:
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,ContactMethods.KIND + "String_Node_Str" + android.provider.Contacts.KIND_POSTAL,null,getSortOrder(projection));
break;
case MODE_JOIN_CONTACT:
mQueryHandler.setLoadingJoinSuggestions(true);
mQueryHandler.startQuery(QUERY_TOKEN,null,uri,projection,null,null,null);
break;
}
}