nus-yam/ex-repair huggingface dataset:
Program: 44413
Project: 44413
Buggy source:
/** 
 * Queries the caller id info with the phone number.
 * @return a CacheEntry containing the caller id info corresponding to the number.
 */
private CacheEntry queryContactInfoByNumber(String number){
  CacheEntry entry=new CacheEntry();
  entry.phoneNumber=number;
  mContactInfoSelectionArgs[0]=number;
  String selection=CALLER_ID_SELECTION.replace("String_Node_Str",PhoneNumberUtils.toCallerIDMinMatch(number));
  Cursor cursor=mContext.getContentResolver().query(PHONES_WITH_PRESENCE_URI,CALLER_ID_PROJECTION,selection,mContactInfoSelectionArgs,null);
  if (cursor == null) {
    Log.w(TAG,"String_Node_Str" + number + "String_Node_Str"+ "String_Node_Str"+ PHONES_WITH_PRESENCE_URI);
    return entry;
  }
  try {
    if (cursor.moveToFirst()) {
      entry.phoneLabel=cursor.getString(PHONE_LABEL_COLUMN);
      entry.name=cursor.getString(CONTACT_NAME_COLUMN);
      entry.person_id=cursor.getLong(CONTACT_ID_COLUMN);
      entry.presenceResId=getPresenceIconResourceId(cursor.getInt(CONTACT_PRESENCE_COLUMN));
      entry.presenceText=cursor.getString(CONTACT_STATUS_COLUMN);
      if (LOCAL_DEBUG) {
        log("String_Node_Str" + entry.name + "String_Node_Str"+ number+ "String_Node_Str"+ entry.presenceResId);
      }
      loadAvatar(entry,cursor);
    }
  }
  finally {
    cursor.close();
  }
  return entry;
}

Fixed version (ground truth):
/** 
 * Queries the caller id info with the phone number.
 * @return a CacheEntry containing the caller id info corresponding to the number.
 */
private CacheEntry queryContactInfoByNumber(String number){
  CacheEntry entry=new CacheEntry();
  entry.phoneNumber=number;
  String contactInfoSelectionArgs[]=new String[1];
  contactInfoSelectionArgs[0]=number;
  String selection=CALLER_ID_SELECTION.replace("String_Node_Str",PhoneNumberUtils.toCallerIDMinMatch(number));
  Cursor cursor=mContext.getContentResolver().query(PHONES_WITH_PRESENCE_URI,CALLER_ID_PROJECTION,selection,contactInfoSelectionArgs,null);
  if (cursor == null) {
    Log.w(TAG,"String_Node_Str" + number + "String_Node_Str"+ "String_Node_Str"+ PHONES_WITH_PRESENCE_URI);
    return entry;
  }
  try {
    if (cursor.moveToFirst()) {
      entry.phoneLabel=cursor.getString(PHONE_LABEL_COLUMN);
      entry.name=cursor.getString(CONTACT_NAME_COLUMN);
      entry.person_id=cursor.getLong(CONTACT_ID_COLUMN);
      entry.presenceResId=getPresenceIconResourceId(cursor.getInt(CONTACT_PRESENCE_COLUMN));
      entry.presenceText=cursor.getString(CONTACT_STATUS_COLUMN);
      if (LOCAL_DEBUG) {
        log("String_Node_Str" + entry.name + "String_Node_Str"+ number+ "String_Node_Str"+ entry.presenceResId);
      }
      loadAvatar(entry,cursor);
    }
  }
  finally {
    cursor.close();
  }
  return entry;
}
Program: 44414
Project: 44414
Buggy source:
/** 
 * Query the contact email table to get the name of an email address.
 */
private CacheEntry queryEmailDisplayName(String email){
  CacheEntry entry=new CacheEntry();
  mContactInfoSelectionArgs[0]=email;
  Cursor cursor=SqliteWrapper.query(mContext,mContext.getContentResolver(),EMAIL_WITH_PRESENCE_URI,EMAIL_PROJECTION,EMAIL_SELECTION,mContactInfoSelectionArgs,null);
  if (cursor != null) {
    try {
      while (cursor.moveToNext()) {
        entry.presenceResId=getPresenceIconResourceId(cursor.getInt(EMAIL_STATUS_COLUMN));
        entry.person_id=cursor.getLong(EMAIL_ID_COLUMN);
        String name=cursor.getString(EMAIL_NAME_COLUMN);
        if (TextUtils.isEmpty(name)) {
          name=cursor.getString(EMAIL_CONTACT_NAME_COLUMN);
        }
        if (!TextUtils.isEmpty(name)) {
          entry.name=name;
          loadAvatar(entry,cursor);
          if (LOCAL_DEBUG) {
            log("String_Node_Str" + entry.name + "String_Node_Str"+ email+ "String_Node_Str"+ entry.presenceResId);
          }
          break;
        }
      }
    }
  finally {
      cursor.close();
    }
  }
  return entry;
}

Fixed version (ground truth):
/** 
 * Query the contact email table to get the name of an email address.
 */
private CacheEntry queryEmailDisplayName(String email){
  CacheEntry entry=new CacheEntry();
  String contactInfoSelectionArgs[]=new String[1];
  contactInfoSelectionArgs[0]=email;
  Cursor cursor=SqliteWrapper.query(mContext,mContext.getContentResolver(),EMAIL_WITH_PRESENCE_URI,EMAIL_PROJECTION,EMAIL_SELECTION,contactInfoSelectionArgs,null);
  if (cursor != null) {
    try {
      while (cursor.moveToNext()) {
        entry.presenceResId=getPresenceIconResourceId(cursor.getInt(EMAIL_STATUS_COLUMN));
        entry.person_id=cursor.getLong(EMAIL_ID_COLUMN);
        String name=cursor.getString(EMAIL_NAME_COLUMN);
        if (TextUtils.isEmpty(name)) {
          name=cursor.getString(EMAIL_CONTACT_NAME_COLUMN);
        }
        if (!TextUtils.isEmpty(name)) {
          entry.name=name;
          loadAvatar(entry,cursor);
          if (LOCAL_DEBUG) {
            log("String_Node_Str" + entry.name + "String_Node_Str"+ email+ "String_Node_Str"+ entry.presenceResId);
          }
          break;
        }
      }
    }
  finally {
      cursor.close();
    }
  }
  return entry;
}
Program: 44415
Project: 44415
Buggy source:
/** 
 * Queries the caller id info with the phone number.
 * @return a CacheEntry containing the caller id info corresponding to the number.
 */
private CacheEntry queryContactInfoByNumber(String number){
  CacheEntry entry=new CacheEntry();
  entry.phoneNumber=number;
  mContactInfoSelectionArgs[0]=number;
  String selection=CALLER_ID_SELECTION.replace("String_Node_Str",PhoneNumberUtils.toCallerIDMinMatch(number));
  Cursor cursor=mContext.getContentResolver().query(PHONES_WITH_PRESENCE_URI,CALLER_ID_PROJECTION,selection,mContactInfoSelectionArgs,null);
  if (cursor == null) {
    Log.w(TAG,"String_Node_Str" + number + "String_Node_Str"+ "String_Node_Str"+ PHONES_WITH_PRESENCE_URI);
    return entry;
  }
  try {
    if (cursor.moveToFirst()) {
      entry.phoneLabel=cursor.getString(PHONE_LABEL_COLUMN);
      entry.name=cursor.getString(CONTACT_NAME_COLUMN);
      entry.person_id=cursor.getLong(CONTACT_ID_COLUMN);
      entry.presenceResId=getPresenceIconResourceId(cursor.getInt(CONTACT_PRESENCE_COLUMN));
      entry.presenceText=cursor.getString(CONTACT_STATUS_COLUMN);
      if (LOCAL_DEBUG) {
        log("String_Node_Str" + entry.name + "String_Node_Str"+ number+ "String_Node_Str"+ entry.presenceResId);
      }
      loadAvatar(entry,cursor);
    }
  }
  finally {
    cursor.close();
  }
  return entry;
}

Fixed version (ground truth):
/** 
 * Queries the caller id info with the phone number.
 * @return a CacheEntry containing the caller id info corresponding to the number.
 */
private CacheEntry queryContactInfoByNumber(String number){
  CacheEntry entry=new CacheEntry();
  entry.phoneNumber=number;
  String contactInfoSelectionArgs[]=new String[1];
  contactInfoSelectionArgs[0]=number;
  String selection=CALLER_ID_SELECTION.replace("String_Node_Str",PhoneNumberUtils.toCallerIDMinMatch(number));
  Cursor cursor=mContext.getContentResolver().query(PHONES_WITH_PRESENCE_URI,CALLER_ID_PROJECTION,selection,contactInfoSelectionArgs,null);
  if (cursor == null) {
    Log.w(TAG,"String_Node_Str" + number + "String_Node_Str"+ "String_Node_Str"+ PHONES_WITH_PRESENCE_URI);
    return entry;
  }
  try {
    if (cursor.moveToFirst()) {
      entry.phoneLabel=cursor.getString(PHONE_LABEL_COLUMN);
      entry.name=cursor.getString(CONTACT_NAME_COLUMN);
      entry.person_id=cursor.getLong(CONTACT_ID_COLUMN);
      entry.presenceResId=getPresenceIconResourceId(cursor.getInt(CONTACT_PRESENCE_COLUMN));
      entry.presenceText=cursor.getString(CONTACT_STATUS_COLUMN);
      if (LOCAL_DEBUG) {
        log("String_Node_Str" + entry.name + "String_Node_Str"+ number+ "String_Node_Str"+ entry.presenceResId);
      }
      loadAvatar(entry,cursor);
    }
  }
  finally {
    cursor.close();
  }
  return entry;
}
Program: 44416
Project: 44416
Buggy source:
private void updateNameAndNumber(){
  mNameAndNumber=formatNameAndNumber(mName,mNumber);
}

Fixed version (ground truth):
private synchronized void updateNameAndNumber(){
  notSynchronizedUpdateNameAndNumber();
}
Program: 44417
Project: 44417
Buggy source:
/** 
 * Queries the caller id info with the phone number.
 * @return a Contact containing the caller id info corresponding to the number.
 */
private Contact getContactInfoForPhoneNumber(String number){
  number=PhoneNumberUtils.stripSeparators(number);
  Contact entry=new Contact(number);
  mContactInfoSelectionArgs[0]=number;
  Cursor cursor=mContext.getContentResolver().query(PHONES_WITH_PRESENCE_URI,CALLER_ID_PROJECTION,CALLER_ID_SELECTION,mContactInfoSelectionArgs,null);
  if (cursor == null) {
    Log.w(TAG,"String_Node_Str" + number + "String_Node_Str"+ "String_Node_Str"+ PHONES_WITH_PRESENCE_URI);
    return entry;
  }
  try {
    if (cursor.moveToFirst()) {
      entry.mLabel=cursor.getString(PHONE_LABEL_COLUMN);
      entry.mName=cursor.getString(CONTACT_NAME_COLUMN);
      entry.mPersonId=cursor.getLong(CONTACT_ID_COLUMN);
      entry.mPresenceResId=getPresenceIconResourceId(cursor.getInt(CONTACT_PRESENCE_COLUMN));
      entry.mPresenceText=cursor.getString(CONTACT_STATUS_COLUMN);
      if (V) {
        log("String_Node_Str" + entry.mName + "String_Node_Str"+ number+ "String_Node_Str"+ entry.mPresenceResId);
      }
      loadAvatarData(entry,cursor);
    }
  }
  finally {
    cursor.close();
  }
  return entry;
}

Fixed version (ground truth):
/** 
 * Queries the caller id info with the phone number.
 * @return a Contact containing the caller id info corresponding to the number.
 */
private Contact getContactInfoForPhoneNumber(String number){
  number=PhoneNumberUtils.stripSeparators(number);
  Contact entry=new Contact(number);
  String selection=CALLER_ID_SELECTION.replace("String_Node_Str",PhoneNumberUtils.toCallerIDMinMatch(number));
  Cursor cursor=mContext.getContentResolver().query(PHONES_WITH_PRESENCE_URI,CALLER_ID_PROJECTION,selection,new String[]{number},null);
  if (cursor == null) {
    Log.w(TAG,"String_Node_Str" + number + "String_Node_Str"+ "String_Node_Str"+ PHONES_WITH_PRESENCE_URI);
    return entry;
  }
  try {
    if (cursor.moveToFirst()) {
synchronized (entry) {
        entry.mLabel=cursor.getString(PHONE_LABEL_COLUMN);
        entry.mName=cursor.getString(CONTACT_NAME_COLUMN);
        entry.mPersonId=cursor.getLong(CONTACT_ID_COLUMN);
        entry.mPresenceResId=getPresenceIconResourceId(cursor.getInt(CONTACT_PRESENCE_COLUMN));
        entry.mPresenceText=cursor.getString(CONTACT_STATUS_COLUMN);
        if (V) {
          log("String_Node_Str" + entry.mName + "String_Node_Str"+ number+ "String_Node_Str"+ entry.mPresenceResId);
        }
      }
      byte[] data=loadAvatarData(entry);
synchronized (entry) {
        entry.mAvatarData=data;
      }
    }
  }
  finally {
    cursor.close();
  }
  return entry;
}
Program: 44418
Project: 44418
Buggy source:
private void updateContact(final Contact c){
  if (c == null) {
    return;
  }
  Contact entry=getContactInfo(c.mNumber);
synchronized (ContactsCache.this) {
    if (contactChanged(c,entry)) {
      if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
        log("String_Node_Str" + entry.mName);
      }
      c.mName=entry.mName;
      c.mNumber=entry.mNumber;
      c.updateNameAndNumber();
      c.mLabel=entry.mLabel;
      c.mPersonId=entry.mPersonId;
      c.mPresenceResId=entry.mPresenceResId;
      c.mPresenceText=entry.mPresenceText;
      c.mAvatarData=entry.mAvatarData;
      c.mAvatar=entry.mAvatar;
      handleLocalNumber(c);
      for (      UpdateListener l : c.mListeners) {
        if (V)         Log.d(TAG,"String_Node_Str" + l);
        l.onUpdate(c);
      }
    }
synchronized (c) {
      c.mQueryPending=false;
      c.notifyAll();
    }
  }
}

Fixed version (ground truth):
private void updateContact(final Contact c){
  if (c == null) {
    return;
  }
  Contact entry=getContactInfo(c.mNumber);
synchronized (c) {
    if (contactChanged(c,entry)) {
      if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
        log("String_Node_Str" + entry.mName);
      }
      c.mNumber=entry.mNumber;
      c.mLabel=entry.mLabel;
      c.mPersonId=entry.mPersonId;
      c.mPresenceResId=entry.mPresenceResId;
      c.mPresenceText=entry.mPresenceText;
      c.mAvatarData=entry.mAvatarData;
      c.mAvatar=entry.mAvatar;
      if (MessageUtils.isLocalNumber(c.mNumber)) {
        c.mName=mContext.getString(com.android.mms.R.string.me);
      }
 else {
        c.mName=entry.mName;
      }
      c.notSynchronizedUpdateNameAndNumber();
      for (      UpdateListener l : c.mListeners) {
        if (V)         Log.d(TAG,"String_Node_Str" + l);
        l.onUpdate(c);
      }
    }
synchronized (c) {
      c.mQueryPending=false;
      c.notifyAll();
    }
  }
}
Program: 44419
Project: 44419
Buggy source:
private void loadAvatarData(Contact entry,Cursor cursor){
  if (entry.mPersonId == 0 || entry.mAvatar != null) {
    return;
  }
  Uri contactUri=ContentUris.withAppendedId(Contacts.CONTENT_URI,entry.mPersonId);
  InputStream avatarDataStream=Contacts.openContactPhotoInputStream(mContext.getContentResolver(),contactUri);
  try {
    if (avatarDataStream != null) {
      byte[] data=new byte[avatarDataStream.available()];
      avatarDataStream.read(data,0,data.length);
      entry.mAvatarData=data;
    }
  }
 catch (  IOException ex) {
  }
 finally {
    try {
      if (avatarDataStream != null) {
        avatarDataStream.close();
      }
    }
 catch (    IOException e) {
    }
  }
}

Fixed version (ground truth):
private byte[] loadAvatarData(Contact entry){
  byte[] data=null;
  if (entry.mPersonId == 0 || entry.mAvatar != null) {
    return null;
  }
  Uri contactUri=ContentUris.withAppendedId(Contacts.CONTENT_URI,entry.mPersonId);
  InputStream avatarDataStream=Contacts.openContactPhotoInputStream(mContext.getContentResolver(),contactUri);
  try {
    if (avatarDataStream != null) {
      data=new byte[avatarDataStream.available()];
      avatarDataStream.read(data,0,data.length);
    }
  }
 catch (  IOException ex) {
  }
 finally {
    try {
      if (avatarDataStream != null) {
        avatarDataStream.close();
      }
    }
 catch (    IOException e) {
    }
  }
  return data;
}
Program: 44420
Project: 44420
Buggy source:
/** 
 * Query the contact email table to get the name of an email address.
 */
private Contact getContactInfoForEmailAddress(String email){
  Contact entry=new Contact(email);
  mContactInfoSelectionArgs[0]=email;
  Cursor cursor=SqliteWrapper.query(mContext,mContext.getContentResolver(),EMAIL_WITH_PRESENCE_URI,EMAIL_PROJECTION,EMAIL_SELECTION,mContactInfoSelectionArgs,null);
  if (cursor != null) {
    try {
      while (cursor.moveToNext()) {
        entry.mPresenceResId=getPresenceIconResourceId(cursor.getInt(EMAIL_STATUS_COLUMN));
        entry.mPersonId=cursor.getLong(EMAIL_ID_COLUMN);
        String name=cursor.getString(EMAIL_NAME_COLUMN);
        if (TextUtils.isEmpty(name)) {
          name=cursor.getString(EMAIL_CONTACT_NAME_COLUMN);
        }
        if (!TextUtils.isEmpty(name)) {
          entry.mName=name;
          loadAvatarData(entry,cursor);
          if (V) {
            log("String_Node_Str" + entry.mName + "String_Node_Str"+ email+ "String_Node_Str"+ entry.mPresenceResId);
          }
          break;
        }
      }
    }
  finally {
      cursor.close();
    }
  }
  return entry;
}

Fixed version (ground truth):
/** 
 * Query the contact email table to get the name of an email address.
 */
private Contact getContactInfoForEmailAddress(String email){
  Contact entry=new Contact(email);
  Cursor cursor=SqliteWrapper.query(mContext,mContext.getContentResolver(),EMAIL_WITH_PRESENCE_URI,EMAIL_PROJECTION,EMAIL_SELECTION,new String[]{email},null);
  if (cursor != null) {
    try {
      while (cursor.moveToNext()) {
        boolean found=false;
synchronized (entry) {
          entry.mPresenceResId=getPresenceIconResourceId(cursor.getInt(EMAIL_STATUS_COLUMN));
          entry.mPersonId=cursor.getLong(EMAIL_ID_COLUMN);
          String name=cursor.getString(EMAIL_NAME_COLUMN);
          if (TextUtils.isEmpty(name)) {
            name=cursor.getString(EMAIL_CONTACT_NAME_COLUMN);
          }
          if (!TextUtils.isEmpty(name)) {
            entry.mName=name;
            if (V) {
              log("String_Node_Str" + entry.mName + "String_Node_Str"+ email+ "String_Node_Str"+ entry.mPresenceResId);
            }
            found=true;
          }
        }
        if (found) {
          byte[] data=loadAvatarData(entry);
synchronized (entry) {
            entry.mAvatarData=data;
          }
          break;
        }
      }
    }
  finally {
      cursor.close();
    }
  }
  return entry;
}
Program: 44421
Project: 44421
Buggy source:
void invalidate(){
synchronized (ContactsCache.this) {
    for (    ArrayList<Contact> alc : mContactsHash.values()) {
      for (      Contact c : alc) {
        c.mIsStale=true;
      }
    }
  }
}

Fixed version (ground truth):
void invalidate(){
synchronized (ContactsCache.this) {
    for (    ArrayList<Contact> alc : mContactsHash.values()) {
      for (      Contact c : alc) {
synchronized (c) {
          c.mIsStale=true;
        }
      }
    }
  }
}
Program: 44422
Project: 44422
Buggy source:
public synchronized void setNumber(String number){
  mNumber=number;
  updateNameAndNumber();
  mNumberIsModified=true;
}

Fixed version (ground truth):
public synchronized void setNumber(String number){
  mNumber=number;
  notSynchronizedUpdateNameAndNumber();
  mNumberIsModified=true;
}
Program: 44423
Project: 44423
Buggy source:
public SlideModel get(int location){
  return mSlides.get(location);
}

Fixed version (ground truth):
public SlideModel get(int location){
  return (location >= 0 && location < mSlides.size()) ? mSlides.get(location) : null;
}
Program: 44424
Project: 44424
Buggy source:
public void onTextChanged(String s){
  mSlideshowEditor.changeText(mPosition,s);
}

Fixed version (ground truth):
public void onTextChanged(String s){
  if (!isFinishing()) {
    mSlideshowEditor.changeText(mPosition,s);
  }
}
Program: 44425
Project: 44425
Buggy source:
private static void asyncUpdateContact(final Contact c,boolean canBlock){
  if (c == null) {
    return;
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + c.toString());
  }
  Runnable r=new Runnable(){
    public void run(){
      updateContact(c);
    }
  }
;
  if (canBlock) {
    r.run();
  }
 else {
    sTaskStack.push(r);
  }
}

Fixed version (ground truth):
private static void asyncUpdateContact(final Contact c,boolean canBlock){
  if (c == null) {
    return;
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + c.toString() + "String_Node_Str"+ canBlock+ "String_Node_Str"+ c.mIsStale);
  }
  Runnable r=new Runnable(){
    public void run(){
      updateContact(c);
    }
  }
;
  if (canBlock) {
    r.run();
  }
 else {
    sTaskStack.push(r);
  }
}
Program: 44426
Project: 44426
Buggy source:
private static void updateContact(final Contact c){
  if (c == null) {
    return;
  }
  c.mIsStale=false;
  if (handleLocalNumber(c)) {
    return;
  }
  ContactInfoCache cache=ContactInfoCache.getInstance();
  ContactInfoCache.CacheEntry entry=cache.getContactInfo(c.mNumber);
synchronized (Cache.getInstance()) {
    if (contactChanged(c,entry)) {
      if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
        log("String_Node_Str" + entry.name);
      }
      c.mName=entry.name;
      c.updateNameAndNumber();
      c.mLabel=entry.phoneLabel;
      c.mPersonId=entry.person_id;
      c.mPresenceResId=entry.presenceResId;
      c.mPresenceText=entry.presenceText;
      c.mAvatar=entry.mAvatar;
      for (      UpdateListener l : c.mListeners) {
        if (V)         Log.d(TAG,"String_Node_Str" + l);
        l.onUpdate(c);
      }
    }
  }
}

Fixed version (ground truth):
private static void updateContact(final Contact c){
  if (c == null) {
    return;
  }
  if (handleLocalNumber(c)) {
    return;
  }
  ContactInfoCache cache=ContactInfoCache.getInstance();
  ContactInfoCache.CacheEntry entry=cache.getContactInfo(c.mNumber);
synchronized (Cache.getInstance()) {
    if (contactChanged(c,entry)) {
      if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
        log("String_Node_Str" + entry.name);
      }
      c.mName=entry.name;
      c.updateNameAndNumber();
      c.mLabel=entry.phoneLabel;
      c.mPersonId=entry.person_id;
      c.mPresenceResId=entry.presenceResId;
      c.mPresenceText=entry.presenceText;
      c.mAvatar=entry.mAvatar;
      c.mIsStale=false;
      for (      UpdateListener l : c.mListeners) {
        if (V)         Log.d(TAG,"String_Node_Str" + l);
        l.onUpdate(c);
      }
    }
  }
}
Program: 44427
Project: 44427
Buggy source:
public void onUpdate(final Contact updated){
  mMessageListItemHandler.post(new Runnable(){
    public void run(){
      ContactList recipients=getRecipients();
      if (recipients.size() == 1) {
        updatePresence(recipients.get(0));
      }
 else {
        updatePresence(null);
      }
    }
  }
);
}

Fixed version (ground truth):
public void onUpdate(final Contact updated){
  mMessageListItemHandler.post(new Runnable(){
    public void run(){
      if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
        log("String_Node_Str" + updated);
      }
      ContactList recipients=getRecipients();
      if (recipients.size() == 1) {
        updatePresence(recipients.get(0));
      }
 else {
        updatePresence(null);
      }
      ComposeMessageActivity.this.mMsgListAdapter.notifyDataSetChanged();
    }
  }
);
}
Program: 44428
Project: 44428
Buggy source:
public void run(){
  ContactList recipients=getRecipients();
  if (recipients.size() == 1) {
    updatePresence(recipients.get(0));
  }
 else {
    updatePresence(null);
  }
}

Fixed version (ground truth):
public void run(){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + updated);
  }
  ContactList recipients=getRecipients();
  if (recipients.size() == 1) {
    updatePresence(recipients.get(0));
  }
 else {
    updatePresence(null);
  }
  ComposeMessageActivity.this.mMsgListAdapter.notifyDataSetChanged();
}
Program: 44429
Project: 44429
Buggy source:
private static void asyncUpdateContact(final Contact c,boolean canBlock){
  if (c == null) {
    return;
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + c.toString());
  }
  Runnable r=new Runnable(){
    public void run(){
      updateContact(c);
    }
  }
;
  if (canBlock) {
    r.run();
  }
 else {
    sTaskStack.push(r);
  }
}

Fixed version (ground truth):
private static void asyncUpdateContact(final Contact c,boolean canBlock){
  if (c == null) {
    return;
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + c.toString() + "String_Node_Str"+ canBlock+ "String_Node_Str"+ c.mIsStale);
  }
  Runnable r=new Runnable(){
    public void run(){
      updateContact(c);
    }
  }
;
  if (canBlock) {
    r.run();
  }
 else {
    sTaskStack.push(r);
  }
}
Program: 44430
Project: 44430
Buggy source:
private static void updateContact(final Contact c){
  if (c == null) {
    return;
  }
  c.mIsStale=false;
  if (handleLocalNumber(c)) {
    return;
  }
  ContactInfoCache cache=ContactInfoCache.getInstance();
  ContactInfoCache.CacheEntry entry=cache.getContactInfo(c.mNumber);
synchronized (Cache.getInstance()) {
    if (contactChanged(c,entry)) {
      if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
        log("String_Node_Str" + entry.name);
      }
      c.mName=entry.name;
      c.updateNameAndNumber();
      c.mLabel=entry.phoneLabel;
      c.mPersonId=entry.person_id;
      c.mPresenceResId=entry.presenceResId;
      c.mPresenceText=entry.presenceText;
      c.mAvatar=entry.mAvatar;
      for (      UpdateListener l : c.mListeners) {
        if (V)         Log.d(TAG,"String_Node_Str" + l);
        l.onUpdate(c);
      }
    }
  }
}

Fixed version (ground truth):
private static void updateContact(final Contact c){
  if (c == null) {
    return;
  }
  if (handleLocalNumber(c)) {
    return;
  }
  ContactInfoCache cache=ContactInfoCache.getInstance();
  ContactInfoCache.CacheEntry entry=cache.getContactInfo(c.mNumber);
synchronized (Cache.getInstance()) {
    if (contactChanged(c,entry)) {
      if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
        log("String_Node_Str" + entry.name);
      }
      c.mName=entry.name;
      c.updateNameAndNumber();
      c.mLabel=entry.phoneLabel;
      c.mPersonId=entry.person_id;
      c.mPresenceResId=entry.presenceResId;
      c.mPresenceText=entry.presenceText;
      c.mAvatar=entry.mAvatar;
      c.mIsStale=false;
      for (      UpdateListener l : c.mListeners) {
        if (V)         Log.d(TAG,"String_Node_Str" + l);
        l.onUpdate(c);
      }
    }
  }
}
Program: 44431
Project: 44431
Buggy source:
public void onUpdate(final Contact updated){
  mMessageListItemHandler.post(new Runnable(){
    public void run(){
      ContactList recipients=getRecipients();
      if (recipients.size() == 1) {
        updatePresence(recipients.get(0));
      }
 else {
        updatePresence(null);
      }
    }
  }
);
}

Fixed version (ground truth):
public void onUpdate(final Contact updated){
  mMessageListItemHandler.post(new Runnable(){
    public void run(){
      if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
        log("String_Node_Str" + updated);
      }
      ContactList recipients=getRecipients();
      if (recipients.size() == 1) {
        updatePresence(recipients.get(0));
      }
 else {
        updatePresence(null);
      }
      ComposeMessageActivity.this.mMsgListAdapter.notifyDataSetChanged();
    }
  }
);
}
Program: 44432
Project: 44432
Buggy source:
public void run(){
  ContactList recipients=getRecipients();
  if (recipients.size() == 1) {
    updatePresence(recipients.get(0));
  }
 else {
    updatePresence(null);
  }
}

Fixed version (ground truth):
public void run(){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + updated);
  }
  ContactList recipients=getRecipients();
  if (recipients.size() == 1) {
    updatePresence(recipients.get(0));
  }
 else {
    updatePresence(null);
  }
  ComposeMessageActivity.this.mMsgListAdapter.notifyDataSetChanged();
}
Program: 44433
Project: 44433
Buggy source:
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri);
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + intentUri + "String_Node_Str"+ threadId);
    log("String_Node_Str" + conversation + "String_Node_Str"+ mConversation);
  }
  if (sameThread || conversation.getThreadId() == mConversation.getThreadId()) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
  }
 else {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
    saveDraft();
    initialize(null);
    loadMessageContent();
  }
}

Fixed version (ground truth):
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri);
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + intentUri + "String_Node_Str"+ threadId);
    log("String_Node_Str" + conversation + "String_Node_Str"+ mConversation);
  }
  long convThreadId=conversation.getThreadId();
  if (sameThread || (convThreadId != 0 && convThreadId == mConversation.getThreadId())) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
  }
 else {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
    saveDraft();
    initialize(null);
    loadMessageContent();
  }
}
Program: 44434
Project: 44434
Buggy source:
public static List<Entry> getAddresses(String spaceSepIds){
synchronized (sInstance) {
    List<Entry> numbers=new ArrayList<Entry>();
    String[] ids=spaceSepIds.split("String_Node_Str");
    for (    String id : ids) {
      long longId;
      try {
        longId=Long.parseLong(id);
      }
 catch (      NumberFormatException ex) {
        continue;
      }
      String number=sInstance.mCache.get(longId);
      if (number == null) {
        Log.w(TAG,"String_Node_Str" + id + "String_Node_Str");
        dump();
        fill();
        number=sInstance.mCache.get(id);
      }
      if (TextUtils.isEmpty(number)) {
        Log.w(TAG,"String_Node_Str" + id + "String_Node_Str");
      }
 else {
        numbers.add(new Entry(longId,number));
      }
    }
    return numbers;
  }
}

Fixed version (ground truth):
public static List<Entry> getAddresses(String spaceSepIds){
synchronized (sInstance) {
    List<Entry> numbers=new ArrayList<Entry>();
    String[] ids=spaceSepIds.split("String_Node_Str");
    for (    String id : ids) {
      long longId;
      try {
        longId=Long.parseLong(id);
      }
 catch (      NumberFormatException ex) {
        continue;
      }
      String number=sInstance.mCache.get(longId);
      if (number == null) {
        Log.w(TAG,"String_Node_Str" + longId + "String_Node_Str");
        dump();
        fill();
        number=sInstance.mCache.get(longId);
      }
      if (TextUtils.isEmpty(number)) {
        Log.w(TAG,"String_Node_Str" + longId + "String_Node_Str");
      }
 else {
        numbers.add(new Entry(longId,number));
      }
    }
    return numbers;
  }
}
Program: 44435
Project: 44435
Buggy source:
public static List<Entry> getAddresses(String spaceSepIds){
synchronized (sInstance) {
    List<Entry> numbers=new ArrayList<Entry>();
    String[] ids=spaceSepIds.split("String_Node_Str");
    for (    String id : ids) {
      long longId;
      try {
        longId=Long.parseLong(id);
      }
 catch (      NumberFormatException ex) {
        continue;
      }
      String number=sInstance.mCache.get(longId);
      if (number == null) {
        Log.w(TAG,"String_Node_Str" + id + "String_Node_Str");
        dump();
        fill();
        number=sInstance.mCache.get(id);
      }
      if (TextUtils.isEmpty(number)) {
        Log.w(TAG,"String_Node_Str" + id + "String_Node_Str");
      }
 else {
        numbers.add(new Entry(longId,number));
      }
    }
    return numbers;
  }
}

Fixed version (ground truth):
public static List<Entry> getAddresses(String spaceSepIds){
synchronized (sInstance) {
    List<Entry> numbers=new ArrayList<Entry>();
    String[] ids=spaceSepIds.split("String_Node_Str");
    for (    String id : ids) {
      long longId;
      try {
        longId=Long.parseLong(id);
      }
 catch (      NumberFormatException ex) {
        continue;
      }
      String number=sInstance.mCache.get(longId);
      if (number == null) {
        Log.w(TAG,"String_Node_Str" + longId + "String_Node_Str");
        dump();
        fill();
        number=sInstance.mCache.get(longId);
      }
      if (TextUtils.isEmpty(number)) {
        Log.w(TAG,"String_Node_Str" + longId + "String_Node_Str");
      }
 else {
        numbers.add(new Entry(longId,number));
      }
    }
    return numbers;
  }
}
Program: 44436
Project: 44436
Buggy source:
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri);
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + intentUri + "String_Node_Str"+ threadId);
    log("String_Node_Str" + conversation + "String_Node_Str"+ mConversation);
  }
  if (sameThread || conversation.getThreadId() == mConversation.getThreadId()) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
  }
 else {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
    saveDraft();
    initialize(null);
    loadMessageContent();
  }
}

Fixed version (ground truth):
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri);
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + intentUri + "String_Node_Str"+ threadId);
    log("String_Node_Str" + conversation + "String_Node_Str"+ mConversation);
  }
  long convThreadId=conversation.getThreadId();
  if (sameThread || (convThreadId != 0 && convThreadId == mConversation.getThreadId())) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
  }
 else {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
    saveDraft();
    initialize(null);
    loadMessageContent();
  }
}
Program: 44437
Project: 44437
Buggy source:
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri);
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + intentUri + "String_Node_Str"+ threadId);
    log("String_Node_Str" + conversation + "String_Node_Str"+ mConversation);
  }
  if (sameThread || conversation.getThreadId() == mConversation.getThreadId()) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
  }
 else {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
    saveDraft();
    initialize(null);
    loadMessageContent();
  }
}

Fixed version (ground truth):
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri);
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + intentUri + "String_Node_Str"+ threadId);
    log("String_Node_Str" + conversation + "String_Node_Str"+ mConversation);
  }
  long convThreadId=conversation.getThreadId();
  if (sameThread || (convThreadId != 0 && convThreadId == mConversation.getThreadId())) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
  }
 else {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
    saveDraft();
    initialize(null);
    loadMessageContent();
  }
}
Program: 44438
Project: 44438
Buggy source:
public static List<Entry> getAddresses(String spaceSepIds){
synchronized (sInstance) {
    List<Entry> numbers=new ArrayList<Entry>();
    String[] ids=spaceSepIds.split("String_Node_Str");
    for (    String id : ids) {
      long longId;
      try {
        longId=Long.parseLong(id);
      }
 catch (      NumberFormatException ex) {
        continue;
      }
      String number=sInstance.mCache.get(longId);
      if (number == null) {
        Log.w(TAG,"String_Node_Str" + id + "String_Node_Str");
        dump();
        fill();
        number=sInstance.mCache.get(id);
      }
      if (TextUtils.isEmpty(number)) {
        Log.w(TAG,"String_Node_Str" + id + "String_Node_Str");
      }
 else {
        numbers.add(new Entry(longId,number));
      }
    }
    return numbers;
  }
}

Fixed version (ground truth):
public static List<Entry> getAddresses(String spaceSepIds){
synchronized (sInstance) {
    List<Entry> numbers=new ArrayList<Entry>();
    String[] ids=spaceSepIds.split("String_Node_Str");
    for (    String id : ids) {
      long longId;
      try {
        longId=Long.parseLong(id);
      }
 catch (      NumberFormatException ex) {
        continue;
      }
      String number=sInstance.mCache.get(longId);
      if (number == null) {
        Log.w(TAG,"String_Node_Str" + longId + "String_Node_Str");
        dump();
        fill();
        number=sInstance.mCache.get(longId);
      }
      if (TextUtils.isEmpty(number)) {
        Log.w(TAG,"String_Node_Str" + longId + "String_Node_Str");
      }
 else {
        numbers.add(new Entry(longId,number));
      }
    }
    return numbers;
  }
}
Program: 44439
Project: 44439
Buggy source:
public static List<Entry> getAddresses(String spaceSepIds){
synchronized (sInstance) {
    List<Entry> numbers=new ArrayList<Entry>();
    String[] ids=spaceSepIds.split("String_Node_Str");
    for (    String id : ids) {
      long longId;
      try {
        longId=Long.parseLong(id);
      }
 catch (      NumberFormatException ex) {
        continue;
      }
      String number=sInstance.mCache.get(longId);
      if (number == null) {
        Log.w(TAG,"String_Node_Str" + id + "String_Node_Str");
        dump();
        fill();
        number=sInstance.mCache.get(id);
      }
      if (TextUtils.isEmpty(number)) {
        Log.w(TAG,"String_Node_Str" + id + "String_Node_Str");
      }
 else {
        numbers.add(new Entry(longId,number));
      }
    }
    return numbers;
  }
}

Fixed version (ground truth):
public static List<Entry> getAddresses(String spaceSepIds){
synchronized (sInstance) {
    List<Entry> numbers=new ArrayList<Entry>();
    String[] ids=spaceSepIds.split("String_Node_Str");
    for (    String id : ids) {
      long longId;
      try {
        longId=Long.parseLong(id);
      }
 catch (      NumberFormatException ex) {
        continue;
      }
      String number=sInstance.mCache.get(longId);
      if (number == null) {
        Log.w(TAG,"String_Node_Str" + longId + "String_Node_Str");
        dump();
        fill();
        number=sInstance.mCache.get(longId);
      }
      if (TextUtils.isEmpty(number)) {
        Log.w(TAG,"String_Node_Str" + longId + "String_Node_Str");
      }
 else {
        numbers.add(new Entry(longId,number));
      }
    }
    return numbers;
  }
}
Program: 44440
Project: 44440
Buggy source:
public static List<Entry> getAddresses(String spaceSepIds){
synchronized (sInstance) {
    List<Entry> numbers=new ArrayList<Entry>();
    String[] ids=spaceSepIds.split("String_Node_Str");
    for (    String id : ids) {
      long longId;
      try {
        longId=Long.parseLong(id);
      }
 catch (      NumberFormatException ex) {
        continue;
      }
      String number=sInstance.mCache.get(longId);
      if (number == null) {
        Log.w(TAG,"String_Node_Str" + id + "String_Node_Str");
        dump();
        fill();
        number=sInstance.mCache.get(id);
      }
      if (TextUtils.isEmpty(number)) {
        Log.w(TAG,"String_Node_Str" + id + "String_Node_Str");
      }
 else {
        numbers.add(new Entry(longId,number));
      }
    }
    return numbers;
  }
}

Fixed version (ground truth):
public static List<Entry> getAddresses(String spaceSepIds){
synchronized (sInstance) {
    List<Entry> numbers=new ArrayList<Entry>();
    String[] ids=spaceSepIds.split("String_Node_Str");
    for (    String id : ids) {
      long longId;
      try {
        longId=Long.parseLong(id);
      }
 catch (      NumberFormatException ex) {
        continue;
      }
      String number=sInstance.mCache.get(longId);
      if (number == null) {
        Log.w(TAG,"String_Node_Str" + longId + "String_Node_Str");
        dump();
        fill();
        number=sInstance.mCache.get(longId);
      }
      if (TextUtils.isEmpty(number)) {
        Log.w(TAG,"String_Node_Str" + longId + "String_Node_Str");
      }
 else {
        numbers.add(new Entry(longId,number));
      }
    }
    return numbers;
  }
}
Program: 44441
Project: 44441
Buggy source:
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri);
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + intentUri + "String_Node_Str"+ threadId);
    log("String_Node_Str" + conversation + "String_Node_Str"+ mConversation);
  }
  if (sameThread || conversation.getThreadId() == mConversation.getThreadId()) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
  }
 else {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
    saveDraft();
    initialize(null);
    loadMessageContent();
  }
}

Fixed version (ground truth):
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri);
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + intentUri + "String_Node_Str"+ threadId);
    log("String_Node_Str" + conversation + "String_Node_Str"+ mConversation);
  }
  long convThreadId=conversation.getThreadId();
  if (sameThread || (convThreadId != 0 && convThreadId == mConversation.getThreadId())) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
  }
 else {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
    saveDraft();
    initialize(null);
    loadMessageContent();
  }
}
Program: 44442
Project: 44442
Buggy source:
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri);
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + intentUri + "String_Node_Str"+ threadId);
    log("String_Node_Str" + conversation + "String_Node_Str"+ mConversation);
  }
  if (sameThread || conversation.getThreadId() == mConversation.getThreadId()) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
  }
 else {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
    saveDraft();
    initialize(null);
    loadMessageContent();
  }
}

Fixed version (ground truth):
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri);
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str" + intentUri + "String_Node_Str"+ threadId);
    log("String_Node_Str" + conversation + "String_Node_Str"+ mConversation);
  }
  long convThreadId=conversation.getThreadId();
  if (sameThread || (convThreadId != 0 && convThreadId == mConversation.getThreadId())) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
  }
 else {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
    saveDraft();
    initialize(null);
    loadMessageContent();
  }
}
Program: 44443
Project: 44443
Buggy source:
/** 
 * Send this message over the network.  Will call back with onMessageSent() once it has been dispatched to the telephony stack.  This WorkingMessage object is no longer useful after this method has been called.
 */
public void send(){
  if (Log.isLoggable(LogTag.TRANSACTION,Log.VERBOSE)) {
    LogTag.debug("String_Node_Str");
  }
  prepareForSave(true);
  final Conversation conv=mConversation;
  String msgTxt=mText.toString();
  if (requiresMms() || addressContainsEmailToMms(conv,msgTxt)) {
    final Uri mmsUri=mMessageUri;
    final PduPersister persister=PduPersister.getPduPersister(mContext);
    final SlideshowModel slideshow=mSlideshow;
    final SendReq sendReq=makeSendReq(conv,mSubject);
    if (sendReq != null) {
      slideshow.prepareForSend();
      new Thread(new Runnable(){
        public void run(){
          sendMmsWorker(conv,mmsUri,persister,slideshow,sendReq);
        }
      }
).start();
    }
 else {
      Log.e(LogTag.TAG,"String_Node_Str");
    }
  }
 else {
    final String msgText=mText.toString();
    new Thread(new Runnable(){
      public void run(){
        sendSmsWorker(conv,msgText);
      }
    }
).start();
  }
  mDiscarded=true;
}

Fixed version (ground truth):
/** 
 * Send this message over the network.  Will call back with onMessageSent() once it has been dispatched to the telephony stack.  This WorkingMessage object is no longer useful after this method has been called.
 */
public void send(){
  if (Log.isLoggable(LogTag.TRANSACTION,Log.VERBOSE)) {
    LogTag.debug("String_Node_Str");
  }
  prepareForSave(true);
  final Conversation conv=mConversation;
  String msgTxt=mText.toString();
  if (requiresMms() || addressContainsEmailToMms(conv,msgTxt)) {
    final Uri mmsUri=mMessageUri;
    final PduPersister persister=PduPersister.getPduPersister(mContext);
    final SlideshowModel slideshow=mSlideshow;
    final SendReq sendReq=makeSendReq(conv,mSubject);
    slideshow.prepareForSend();
    new Thread(new Runnable(){
      public void run(){
        sendMmsWorker(conv,mmsUri,persister,slideshow,sendReq);
      }
    }
).start();
  }
 else {
    final String msgText=mText.toString();
    new Thread(new Runnable(){
      public void run(){
        sendSmsWorker(conv,msgText);
      }
    }
).start();
  }
  mDiscarded=true;
}