Program: 86040
Project: 86040
Buggy source:
/** 
 * Searches on the phone contacts for one that has an email address matching the   {@link User}'s. <p>If one is found, then the   {@code User} is notified through {@link User#setExistsOnPhone(boolean) setExistsOnPhone()}that it exists in the phone's contacts. All the phone numbers available for this contact are added to the  {@code User}'s   {@code ArrayList} of phone numbers.
 * @param user the user to search for on phone and that may be updated
 */
private void searchForContactOnPhone(User user){
  Cursor contacts=getContentResolver().query(ContactsContract.CommonDataKinds.Email.CONTENT_URI,null,ContactsContract.CommonDataKinds.Email.ADDRESS + "String_Node_Str",new String[]{user.getEmail()},null);
  if (contacts.moveToNext()) {
    user.setExistsOnPhone(true);
    String contactId=contacts.getString(contacts.getColumnIndex(ContactsContract.CommonDataKinds.Identity.CONTACT_ID));
    Cursor contactPhones=getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null,ContactsContract.CommonDataKinds.Phone.CONTACT_ID + "String_Node_Str",new String[]{contactId},null);
    String result="String_Node_Str" + user.getEmail() + "String_Node_Str"+ contactId+ "String_Node_Str"+ contacts.getString(contacts.getColumnIndex(ContactsContract.CommonDataKinds.Identity.DISPLAY_NAME));
    while (contactPhones.moveToNext()) {
      String phoneNumber=contactPhones.getString(contactPhones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
      int phoneTypeCode=contactPhones.getInt(contactPhones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));
      String phoneLabel=contactPhones.getString(contactPhones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.LABEL));
      String phoneType=ContactsContract.CommonDataKinds.Phone.getTypeLabel(getResources(),phoneTypeCode,phoneLabel).toString();
      result+="String_Node_Str" + phoneNumber + "String_Node_Str"+ phoneType;
      user.addPhoneNumber(phoneNumber,phoneType);
    }
    Log.i(LOG_TAG,result);
  }
}

Fixed version (ground truth):
/** 
 * Searches on the phone contacts for one that has an email address matching the   {@link User}'s. <p>If one is found, then the   {@code User} is notified through {@link User#setExistsOnPhone(boolean) setExistsOnPhone()}that it exists in the phone's contacts. All the phone numbers available for this contact are added to the  {@code User}'s   {@code ArrayList} of phone numbers.
 * @param user the user to search for on phone and that may be updated
 */
private void searchForContactOnPhone(User user){
  Cursor contacts=getContentResolver().query(ContactsContract.CommonDataKinds.Email.CONTENT_URI,null,ContactsContract.CommonDataKinds.Email.ADDRESS + "String_Node_Str",new String[]{user.getEmail()},null);
  if (contacts.moveToNext()) {
    user.setExistsOnPhone(true);
    String contactId=contacts.getString(contacts.getColumnIndex(ContactsContract.CommonDataKinds.Identity.CONTACT_ID));
    Cursor contactPhones=getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null,ContactsContract.CommonDataKinds.Phone.CONTACT_ID + "String_Node_Str",new String[]{contactId},null);
    String result="String_Node_Str" + user.getEmail() + "String_Node_Str"+ contactId+ "String_Node_Str"+ contacts.getString(contacts.getColumnIndex(ContactsContract.CommonDataKinds.Identity.DISPLAY_NAME));
    while (contactPhones.moveToNext()) {
      String phoneNumber=contactPhones.getString(contactPhones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
      int phoneTypeCode=contactPhones.getInt(contactPhones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));
      String phoneLabel=contactPhones.getString(contactPhones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.LABEL));
      String phoneType=ContactsContract.CommonDataKinds.Phone.getTypeLabel(getResources(),phoneTypeCode,phoneLabel).toString();
      result+="String_Node_Str" + phoneNumber + "String_Node_Str"+ phoneType;
      user.addPhoneNumber(phoneNumber,phoneType,phoneTypeCode);
    }
    Log.i(LOG_TAG,result);
  }
}