nus-yam/ex-repair huggingface dataset:
Program: 44543
Project: 44543
Buggy source:
public final void bind(Context context,final ConversationHeader ch){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  setConversationHeader(ch);
  LayoutParams attachmentLayout=(LayoutParams)mAttachmentView.getLayoutParams();
  boolean hasError=ch.hasError();
  if (hasError) {
    attachmentLayout.addRule(RelativeLayout.LEFT_OF,R.id.error);
  }
 else {
    attachmentLayout.addRule(RelativeLayout.LEFT_OF,R.id.date);
  }
  boolean hasAttachment=ch.hasAttachment();
  mAttachmentView.setVisibility(hasAttachment ? VISIBLE : GONE);
  mDateView.setText(ch.getDate());
  mFromView.setText(formatMessage(ch));
  ContactList contacts=ch.getContacts();
  contacts.addListeners(this);
  setPresenceIcon(contacts.getPresenceResId());
  mSubjectView.setText(ch.getSubject());
  LayoutParams subjectLayout=(LayoutParams)mSubjectView.getLayoutParams();
  subjectLayout.addRule(RelativeLayout.LEFT_OF,hasAttachment ? R.id.attachment : (hasError ? R.id.error : R.id.date));
  mErrorIndicator.setVisibility(hasError ? VISIBLE : GONE);
  updateAvatarView();
}

Fixed version (ground truth):
public final void bind(Context context,final ConversationHeader ch){
  setConversationHeader(ch);
  LayoutParams attachmentLayout=(LayoutParams)mAttachmentView.getLayoutParams();
  boolean hasError=ch.hasError();
  if (hasError) {
    attachmentLayout.addRule(RelativeLayout.LEFT_OF,R.id.error);
  }
 else {
    attachmentLayout.addRule(RelativeLayout.LEFT_OF,R.id.date);
  }
  boolean hasAttachment=ch.hasAttachment();
  mAttachmentView.setVisibility(hasAttachment ? VISIBLE : GONE);
  mDateView.setText(ch.getDate());
  mFromView.setText(formatMessage(ch));
  ContactList contacts=ch.getContacts();
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + this);
  contacts.addListeners(this);
  setPresenceIcon(contacts.getPresenceResId());
  mSubjectView.setText(ch.getSubject());
  LayoutParams subjectLayout=(LayoutParams)mSubjectView.getLayoutParams();
  subjectLayout.addRule(RelativeLayout.LEFT_OF,hasAttachment ? R.id.attachment : (hasError ? R.id.error : R.id.date));
  mErrorIndicator.setVisibility(hasError ? VISIBLE : GONE);
  updateAvatarView();
}
Program: 44544
Project: 44544
Buggy source:
public final void unbind(){
  mConversationHeader.getContacts().removeListeners(this);
}

Fixed version (ground truth):
public final void unbind(){
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + this);
  mConversationHeader.getContacts().removeListeners(this);
}
Program: 44545
Project: 44545
Buggy source:
private void initListAdapter(){
  mListAdapter=new ConversationListAdapter(this,null);
  setListAdapter(mListAdapter);
}

Fixed version (ground truth):
private void initListAdapter(){
  mListAdapter=new ConversationListAdapter(this,null);
  setListAdapter(mListAdapter);
  getListView().setRecyclerListener(mListAdapter);
}
Program: 44546
Project: 44546
Buggy source:
@Override protected void onStop(){
  super.onStop();
  mListAdapter.changeCursor(null);
}

Fixed version (ground truth):
@Override protected void onStop(){
  super.onStop();
  DraftCache.getInstance().removeOnDraftChangedListener(this);
  mListAdapter.changeCursor(null);
}
Program: 44547
Project: 44547
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setContentView(R.layout.conversation_list_screen);
  mQueryHandler=new ThreadListQueryHandler(getContentResolver());
  ListView listView=getListView();
  LayoutInflater inflater=LayoutInflater.from(this);
  ConversationHeaderView headerView=(ConversationHeaderView)inflater.inflate(R.layout.conversation_header,listView,false);
  headerView.bind(getString(R.string.new_message),getString(R.string.create_new_message));
  listView.addHeaderView(headerView,null,true);
  listView.setOnCreateContextMenuListener(mConvListOnCreateContextMenuListener);
  listView.setOnKeyListener(mThreadListKeyListener);
  initListAdapter();
  handleCreationIntent(getIntent());
  mHandler=new Handler();
  mPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  boolean checkedMessageLimits=mPrefs.getBoolean(CHECKED_MESSAGE_LIMITS,false);
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + checkedMessageLimits);
  if (!checkedMessageLimits || DEBUG) {
    runOneTimeStorageLimitCheckForLegacyMessages();
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setContentView(R.layout.conversation_list_screen);
  mQueryHandler=new ThreadListQueryHandler(getContentResolver());
  ListView listView=getListView();
  LayoutInflater inflater=LayoutInflater.from(this);
  ConversationHeaderView headerView=(ConversationHeaderView)inflater.inflate(R.layout.conversation_header,listView,false);
  headerView.bind(getString(R.string.new_message),getString(R.string.create_new_message));
  listView.addHeaderView(headerView,null,true);
  listView.setOnCreateContextMenuListener(mConvListOnCreateContextMenuListener);
  listView.setOnKeyListener(mThreadListKeyListener);
  initListAdapter();
  mTitle=getString(R.string.app_label);
  mHandler=new Handler();
  mPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  boolean checkedMessageLimits=mPrefs.getBoolean(CHECKED_MESSAGE_LIMITS,false);
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + checkedMessageLimits);
  if (!checkedMessageLimits || DEBUG) {
    runOneTimeStorageLimitCheckForLegacyMessages();
  }
}
Program: 44548
Project: 44548
Buggy source:
public void onDraftChanged(long threadId,boolean hasDraft){
  mQueryHandler.post(new Runnable(){
    public void run(){
      mListAdapter.notifyDataSetChanged();
    }
  }
);
}

Fixed version (ground truth):
public void onDraftChanged(final long threadId,final boolean hasDraft){
  mQueryHandler.post(new Runnable(){
    public void run(){
      if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
        log("String_Node_Str" + threadId + "String_Node_Str"+ hasDraft);
      }
      mListAdapter.notifyDataSetChanged();
    }
  }
);
}
Program: 44549
Project: 44549
Buggy source:
@Override protected void onNewIntent(Intent intent){
  handleCreationIntent(intent);
}

Fixed version (ground truth):
@Override protected void onNewIntent(Intent intent){
  privateOnStart();
}
Program: 44550
Project: 44550
Buggy source:
/** 
 * Updates the has-draft status of a particular thread on a piecemeal basis, to be called when a draft has appeared or disappeared.
 */
public synchronized void setDraftState(long threadId,boolean hasDraft){
  if (threadId <= 0) {
    return;
  }
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + threadId + "String_Node_Str"+ hasDraft);
  }
  boolean changed;
  if (hasDraft) {
    changed=mDraftSet.add(threadId);
  }
 else {
    changed=mDraftSet.remove(threadId);
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    dump();
  }
  if (changed) {
    for (    OnDraftChangedListener l : mChangeListeners) {
      l.onDraftChanged(threadId,hasDraft);
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the has-draft status of a particular thread on a piecemeal basis, to be called when a draft has appeared or disappeared.
 */
public synchronized void setDraftState(long threadId,boolean hasDraft){
  if (threadId <= 0) {
    return;
  }
  boolean changed;
  if (hasDraft) {
    changed=mDraftSet.add(threadId);
  }
 else {
    changed=mDraftSet.remove(threadId);
  }
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + threadId + "String_Node_Str"+ hasDraft+ "String_Node_Str"+ changed);
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    dump();
  }
  if (changed) {
    for (    OnDraftChangedListener l : mChangeListeners) {
      l.onDraftChanged(threadId,hasDraft);
    }
  }
}
Program: 44551
Project: 44551
Buggy source:
public synchronized void addOnDraftChangedListener(OnDraftChangedListener l){
  mChangeListeners.add(l);
}

Fixed version (ground truth):
public synchronized void addOnDraftChangedListener(OnDraftChangedListener l){
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + l);
  }
  mChangeListeners.add(l);
}
Program: 44552
Project: 44552
Buggy source:
public synchronized void removeOnDraftChangedListener(OnDraftChangedListener l){
  mChangeListeners.remove(l);
}

Fixed version (ground truth):
public synchronized void removeOnDraftChangedListener(OnDraftChangedListener l){
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + l);
  }
  mChangeListeners.remove(l);
}
Program: 44553
Project: 44553
Buggy source:
@Override public Cursor runQueryOnBackgroundThread(CharSequence constraint){
  String phone="String_Node_Str";
  String cons=null;
  if (constraint != null) {
    cons=constraint.toString();
    if (usefulAsDigits(cons)) {
      phone=PhoneNumberUtils.convertKeypadLettersToDigits(cons);
      if (phone.equals(cons)) {
        phone="String_Node_Str";
      }
 else {
        phone=phone.trim();
      }
    }
  }
  Uri uri=Uri.withAppendedPath(Phone.CONTENT_FILTER_URI,Uri.encode(cons));
  Cursor phoneCursor=mContentResolver.query(uri,PROJECTION_PHONE,Phone.TYPE + "String_Node_Str" + Phone.TYPE_MOBILE,null,SORT_ORDER);
  if (phone.length() > 0) {
    ArrayList result=new ArrayList();
    result.add(Integer.valueOf(-1));
    result.add(Long.valueOf(-1));
    result.add(Integer.valueOf(Phone.TYPE_CUSTOM));
    result.add(phone);
    result.add("String_Node_Str");
    result.add(cons);
    ArrayList<ArrayList> wrap=new ArrayList<ArrayList>();
    wrap.add(result);
    ArrayListCursor translated=new ArrayListCursor(PROJECTION_PHONE,wrap);
    return new MergeCursor(new Cursor[]{translated,phoneCursor});
  }
 else {
    return phoneCursor;
  }
}

Fixed version (ground truth):
@Override public Cursor runQueryOnBackgroundThread(CharSequence constraint){
  String phone="String_Node_Str";
  String cons=null;
  if (constraint != null) {
    cons=constraint.toString();
    if (usefulAsDigits(cons)) {
      phone=PhoneNumberUtils.convertKeypadLettersToDigits(cons);
      if (phone.equals(cons)) {
        phone="String_Node_Str";
      }
 else {
        phone=phone.trim();
      }
    }
  }
  Uri uri=Uri.withAppendedPath(Phone.CONTENT_FILTER_URI,Uri.encode(cons));
  Cursor phoneCursor=mContentResolver.query(uri,PROJECTION_PHONE,Phone.TYPE + '=' + Phone.TYPE_MOBILE+ "String_Node_Str"+ Phone.TYPE+ '='+ Phone.TYPE_WORK_MOBILE,null,SORT_ORDER);
  if (phone.length() > 0) {
    ArrayList result=new ArrayList();
    result.add(Integer.valueOf(-1));
    result.add(Long.valueOf(-1));
    result.add(Integer.valueOf(Phone.TYPE_CUSTOM));
    result.add(phone);
    result.add("String_Node_Str");
    result.add(cons);
    ArrayList<ArrayList> wrap=new ArrayList<ArrayList>();
    wrap.add(result);
    ArrayListCursor translated=new ArrayListCursor(PROJECTION_PHONE,wrap);
    return new MergeCursor(new Cursor[]{translated,phoneCursor});
  }
 else {
    return phoneCursor;
  }
}
Program: 44554
Project: 44554
Buggy source:
private void internalAdd(MediaModel media) throws IllegalStateException {
  if (media == null) {
    return;
  }
  if (media.isText()) {
    internalAddOrReplace(mText,media);
    mText=media;
  }
 else   if (media.isImage()) {
    if (mCanAddImage) {
      internalAddOrReplace(mImage,media);
      mImage=media;
      mCanAddVideo=false;
    }
 else {
      throw new IllegalStateException();
    }
  }
 else   if (media.isAudio()) {
    if (mCanAddAudio) {
      internalAddOrReplace(mAudio,media);
      mAudio=media;
      mCanAddVideo=false;
    }
 else {
      throw new IllegalStateException();
    }
  }
 else   if (media.isVideo()) {
    if (mCanAddVideo) {
      internalAddOrReplace(mVideo,media);
      mVideo=media;
      mCanAddImage=false;
      mCanAddAudio=false;
    }
 else {
      throw new IllegalStateException();
    }
  }
}

Fixed version (ground truth):
private void internalAdd(MediaModel media) throws IllegalStateException {
  if (media == null) {
    return;
  }
  if (media.isText()) {
    String contentType=media.getContentType();
    if (TextUtils.isEmpty(contentType) || "String_Node_Str".equals(contentType)) {
      internalAddOrReplace(mText,media);
      mText=media;
    }
 else {
      Log.w(TAG,"String_Node_Str" + media.getContentType() + "String_Node_Str");
    }
  }
 else   if (media.isImage()) {
    if (mCanAddImage) {
      internalAddOrReplace(mImage,media);
      mImage=media;
      mCanAddVideo=false;
    }
 else {
      throw new IllegalStateException();
    }
  }
 else   if (media.isAudio()) {
    if (mCanAddAudio) {
      internalAddOrReplace(mAudio,media);
      mAudio=media;
      mCanAddVideo=false;
    }
 else {
      throw new IllegalStateException();
    }
  }
 else   if (media.isVideo()) {
    if (mCanAddVideo) {
      internalAddOrReplace(mVideo,media);
      mVideo=media;
      mCanAddImage=false;
      mCanAddAudio=false;
    }
 else {
      throw new IllegalStateException();
    }
  }
}
Program: 44556
Project: 44556
Buggy source:
private void drawBottomPanel(){
  resetCounter();
  if (mWorkingMessage.hasSlideshow()) {
    mBottomPanel.setVisibility(View.GONE);
    mAttachmentEditor.requestFocus();
    return;
  }
  mBottomPanel.setVisibility(View.VISIBLE);
  mTextEditor.setTextKeepState(mWorkingMessage.getText());
}

Fixed version (ground truth):
private void drawBottomPanel(){
  resetCounter();
  if (mWorkingMessage.hasSlideshow()) {
    mBottomPanel.setVisibility(View.GONE);
    mAttachmentEditor.requestFocus();
    return;
  }
  mBottomPanel.setVisibility(View.VISIBLE);
  CharSequence text=mWorkingMessage.getText();
  if (text != null) {
    mTextEditor.setTextKeepState(text);
  }
 else {
    mTextEditor.setText("String_Node_Str");
  }
}
Program: 44557
Project: 44557
Buggy source:
private void drawBottomPanel(){
  resetCounter();
  if (mWorkingMessage.hasSlideshow()) {
    mBottomPanel.setVisibility(View.GONE);
    mAttachmentEditor.requestFocus();
    return;
  }
  mBottomPanel.setVisibility(View.VISIBLE);
  mTextEditor.setTextKeepState(mWorkingMessage.getText());
}

Fixed version (ground truth):
private void drawBottomPanel(){
  resetCounter();
  if (mWorkingMessage.hasSlideshow()) {
    mBottomPanel.setVisibility(View.GONE);
    mAttachmentEditor.requestFocus();
    return;
  }
  mBottomPanel.setVisibility(View.VISIBLE);
  CharSequence text=mWorkingMessage.getText();
  if (text != null) {
    mTextEditor.setTextKeepState(text);
  }
 else {
    mTextEditor.setText("String_Node_Str");
  }
}
Program: 44558
Project: 44558
Buggy source:
@Override public Cursor runQueryOnBackgroundThread(CharSequence constraint){
  String phone="String_Node_Str";
  String cons=null;
  if (constraint != null) {
    cons=constraint.toString();
    if (usefulAsDigits(cons)) {
      phone=PhoneNumberUtils.convertKeypadLettersToDigits(cons);
      if (phone.equals(cons)) {
        phone="String_Node_Str";
      }
 else {
        phone=phone.trim();
      }
    }
  }
  Uri uri=Uri.withAppendedPath(Phone.CONTENT_FILTER_URI,Uri.encode(cons));
  Cursor phoneCursor=mContentResolver.query(uri,PROJECTION_PHONE,Phone.TYPE + "String_Node_Str" + Phone.TYPE_MOBILE,null,SORT_ORDER);
  if (phone.length() > 0) {
    ArrayList result=new ArrayList();
    result.add(Integer.valueOf(-1));
    result.add(Long.valueOf(-1));
    result.add(Integer.valueOf(Phone.TYPE_CUSTOM));
    result.add(phone);
    result.add("String_Node_Str");
    result.add(cons);
    ArrayList<ArrayList> wrap=new ArrayList<ArrayList>();
    wrap.add(result);
    ArrayListCursor translated=new ArrayListCursor(PROJECTION_PHONE,wrap);
    return new MergeCursor(new Cursor[]{translated,phoneCursor});
  }
 else {
    return phoneCursor;
  }
}

Fixed version (ground truth):
@Override public Cursor runQueryOnBackgroundThread(CharSequence constraint){
  String phone="String_Node_Str";
  String cons=null;
  if (constraint != null) {
    cons=constraint.toString();
    if (usefulAsDigits(cons)) {
      phone=PhoneNumberUtils.convertKeypadLettersToDigits(cons);
      if (phone.equals(cons)) {
        phone="String_Node_Str";
      }
 else {
        phone=phone.trim();
      }
    }
  }
  Uri uri=Uri.withAppendedPath(Phone.CONTENT_FILTER_URI,Uri.encode(cons));
  Cursor phoneCursor=mContentResolver.query(uri,PROJECTION_PHONE,Phone.TYPE + '=' + Phone.TYPE_MOBILE+ "String_Node_Str"+ Phone.TYPE+ '='+ Phone.TYPE_WORK_MOBILE,null,SORT_ORDER);
  if (phone.length() > 0) {
    ArrayList result=new ArrayList();
    result.add(Integer.valueOf(-1));
    result.add(Long.valueOf(-1));
    result.add(Integer.valueOf(Phone.TYPE_CUSTOM));
    result.add(phone);
    result.add("String_Node_Str");
    result.add(cons);
    ArrayList<ArrayList> wrap=new ArrayList<ArrayList>();
    wrap.add(result);
    ArrayListCursor translated=new ArrayListCursor(PROJECTION_PHONE,wrap);
    return new MergeCursor(new Cursor[]{translated,phoneCursor});
  }
 else {
    return phoneCursor;
  }
}
Program: 44559
Project: 44559
Buggy source:
public synchronized void addListener(UpdateListener l){
  mListeners.add(l);
}

Fixed version (ground truth):
public synchronized void addListener(UpdateListener l){
  boolean added=mListeners.add(l);
  if (V && added)   dumpListeners();
}
Program: 44560
Project: 44560
Buggy source:
@Override public void onChange(boolean selfUpdate){
  invalidateCache();
}

Fixed version (ground truth):
@Override public void onChange(boolean selfUpdate){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str");
  }
  invalidateCache();
}
Program: 44561
Project: 44561
Buggy source:
public synchronized void removeListener(UpdateListener l){
  mListeners.remove(l);
}

Fixed version (ground truth):
public synchronized void removeListener(UpdateListener l){
  boolean removed=mListeners.remove(l);
  if (V && removed)   dumpListeners();
}
Program: 44562
Project: 44562
Buggy source:
@Override protected void onPause(){
  super.onPause();
  Contact.stopPresenceObserver();
  removeRecipientsListeners();
}

Fixed version (ground truth):
@Override protected void onPause(){
  super.onPause();
  removeRecipientsListeners();
}
Program: 44563
Project: 44563
Buggy source:
@Override protected void onResume(){
  super.onResume();
  Contact.startPresenceObserver();
  addRecipientsListeners();
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  addRecipientsListeners();
}
Program: 44564
Project: 44564
Buggy source:
public final void bind(Context context,final ConversationHeader ch){
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
  setConversationHeader(ch);
  LayoutParams attachmentLayout=(LayoutParams)mAttachmentView.getLayoutParams();
  boolean hasError=ch.hasError();
  if (hasError) {
    attachmentLayout.addRule(RelativeLayout.LEFT_OF,R.id.error);
  }
 else {
    attachmentLayout.addRule(RelativeLayout.LEFT_OF,R.id.date);
  }
  boolean hasAttachment=ch.hasAttachment();
  mAttachmentView.setVisibility(hasAttachment ? VISIBLE : GONE);
  mDateView.setText(ch.getDate());
  mFromView.setText(formatMessage(ch));
  ContactList contacts=ch.getContacts();
  contacts.addListeners(this);
  setPresenceIcon(contacts.getPresenceResId());
  mSubjectView.setText(ch.getSubject());
  LayoutParams subjectLayout=(LayoutParams)mSubjectView.getLayoutParams();
  subjectLayout.addRule(RelativeLayout.LEFT_OF,hasAttachment ? R.id.attachment : (hasError ? R.id.error : R.id.date));
  mErrorIndicator.setVisibility(hasError ? VISIBLE : GONE);
  updateAvatarView();
}

Fixed version (ground truth):
public final void bind(Context context,final ConversationHeader ch){
  setConversationHeader(ch);
  LayoutParams attachmentLayout=(LayoutParams)mAttachmentView.getLayoutParams();
  boolean hasError=ch.hasError();
  if (hasError) {
    attachmentLayout.addRule(RelativeLayout.LEFT_OF,R.id.error);
  }
 else {
    attachmentLayout.addRule(RelativeLayout.LEFT_OF,R.id.date);
  }
  boolean hasAttachment=ch.hasAttachment();
  mAttachmentView.setVisibility(hasAttachment ? VISIBLE : GONE);
  mDateView.setText(ch.getDate());
  mFromView.setText(formatMessage(ch));
  ContactList contacts=ch.getContacts();
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + this);
  contacts.addListeners(this);
  setPresenceIcon(contacts.getPresenceResId());
  mSubjectView.setText(ch.getSubject());
  LayoutParams subjectLayout=(LayoutParams)mSubjectView.getLayoutParams();
  subjectLayout.addRule(RelativeLayout.LEFT_OF,hasAttachment ? R.id.attachment : (hasError ? R.id.error : R.id.date));
  mErrorIndicator.setVisibility(hasError ? VISIBLE : GONE);
  updateAvatarView();
}
Program: 44565
Project: 44565
Buggy source:
public final void unbind(){
  mConversationHeader.getContacts().removeListeners(this);
}

Fixed version (ground truth):
public final void unbind(){
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + this);
  mConversationHeader.getContacts().removeListeners(this);
}
Program: 44566
Project: 44566
Buggy source:
private void initListAdapter(){
  mListAdapter=new ConversationListAdapter(this,null);
  setListAdapter(mListAdapter);
}

Fixed version (ground truth):
private void initListAdapter(){
  mListAdapter=new ConversationListAdapter(this,null);
  setListAdapter(mListAdapter);
  getListView().setRecyclerListener(mListAdapter);
}
Program: 44567
Project: 44567
Buggy source:
@Override protected void onStop(){
  super.onStop();
  mListAdapter.changeCursor(null);
}

Fixed version (ground truth):
@Override protected void onStop(){
  super.onStop();
  DraftCache.getInstance().removeOnDraftChangedListener(this);
  mListAdapter.changeCursor(null);
}
Program: 44568
Project: 44568
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setContentView(R.layout.conversation_list_screen);
  mQueryHandler=new ThreadListQueryHandler(getContentResolver());
  ListView listView=getListView();
  LayoutInflater inflater=LayoutInflater.from(this);
  ConversationHeaderView headerView=(ConversationHeaderView)inflater.inflate(R.layout.conversation_header,listView,false);
  headerView.bind(getString(R.string.new_message),getString(R.string.create_new_message));
  listView.addHeaderView(headerView,null,true);
  listView.setOnCreateContextMenuListener(mConvListOnCreateContextMenuListener);
  listView.setOnKeyListener(mThreadListKeyListener);
  initListAdapter();
  handleCreationIntent(getIntent());
  mHandler=new Handler();
  mPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  boolean checkedMessageLimits=mPrefs.getBoolean(CHECKED_MESSAGE_LIMITS,false);
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + checkedMessageLimits);
  if (!checkedMessageLimits || DEBUG) {
    runOneTimeStorageLimitCheckForLegacyMessages();
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setContentView(R.layout.conversation_list_screen);
  mQueryHandler=new ThreadListQueryHandler(getContentResolver());
  ListView listView=getListView();
  LayoutInflater inflater=LayoutInflater.from(this);
  ConversationHeaderView headerView=(ConversationHeaderView)inflater.inflate(R.layout.conversation_header,listView,false);
  headerView.bind(getString(R.string.new_message),getString(R.string.create_new_message));
  listView.addHeaderView(headerView,null,true);
  listView.setOnCreateContextMenuListener(mConvListOnCreateContextMenuListener);
  listView.setOnKeyListener(mThreadListKeyListener);
  initListAdapter();
  mTitle=getString(R.string.app_label);
  mHandler=new Handler();
  mPrefs=PreferenceManager.getDefaultSharedPreferences(this);
  boolean checkedMessageLimits=mPrefs.getBoolean(CHECKED_MESSAGE_LIMITS,false);
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + checkedMessageLimits);
  if (!checkedMessageLimits || DEBUG) {
    runOneTimeStorageLimitCheckForLegacyMessages();
  }
}
Program: 44569
Project: 44569
Buggy source:
public void onDraftChanged(long threadId,boolean hasDraft){
  mQueryHandler.post(new Runnable(){
    public void run(){
      mListAdapter.notifyDataSetChanged();
    }
  }
);
}

Fixed version (ground truth):
public void onDraftChanged(final long threadId,final boolean hasDraft){
  mQueryHandler.post(new Runnable(){
    public void run(){
      if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
        log("String_Node_Str" + threadId + "String_Node_Str"+ hasDraft);
      }
      mListAdapter.notifyDataSetChanged();
    }
  }
);
}
Program: 44570
Project: 44570
Buggy source:
@Override protected void onNewIntent(Intent intent){
  handleCreationIntent(intent);
}

Fixed version (ground truth):
@Override protected void onNewIntent(Intent intent){
  privateOnStart();
}
Program: 44571
Project: 44571
Buggy source:
/** 
 * Updates the has-draft status of a particular thread on a piecemeal basis, to be called when a draft has appeared or disappeared.
 */
public synchronized void setDraftState(long threadId,boolean hasDraft){
  if (threadId <= 0) {
    return;
  }
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + threadId + "String_Node_Str"+ hasDraft);
  }
  boolean changed;
  if (hasDraft) {
    changed=mDraftSet.add(threadId);
  }
 else {
    changed=mDraftSet.remove(threadId);
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    dump();
  }
  if (changed) {
    for (    OnDraftChangedListener l : mChangeListeners) {
      l.onDraftChanged(threadId,hasDraft);
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the has-draft status of a particular thread on a piecemeal basis, to be called when a draft has appeared or disappeared.
 */
public synchronized void setDraftState(long threadId,boolean hasDraft){
  if (threadId <= 0) {
    return;
  }
  boolean changed;
  if (hasDraft) {
    changed=mDraftSet.add(threadId);
  }
 else {
    changed=mDraftSet.remove(threadId);
  }
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + threadId + "String_Node_Str"+ hasDraft+ "String_Node_Str"+ changed);
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    dump();
  }
  if (changed) {
    for (    OnDraftChangedListener l : mChangeListeners) {
      l.onDraftChanged(threadId,hasDraft);
    }
  }
}
Program: 44572
Project: 44572
Buggy source:
public synchronized void addOnDraftChangedListener(OnDraftChangedListener l){
  mChangeListeners.add(l);
}

Fixed version (ground truth):
public synchronized void addOnDraftChangedListener(OnDraftChangedListener l){
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + l);
  }
  mChangeListeners.add(l);
}
Program: 44573
Project: 44573
Buggy source:
public synchronized void removeOnDraftChangedListener(OnDraftChangedListener l){
  mChangeListeners.remove(l);
}

Fixed version (ground truth):
public synchronized void removeOnDraftChangedListener(OnDraftChangedListener l){
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + l);
  }
  mChangeListeners.remove(l);
}
Program: 44574
Project: 44574
Buggy source:
/** 
 * Removes the subject if it is empty, possibly converting back to SMS.
 */
private void removeSubjectIfEmpty(){
  if (!hasSubject()) {
    setSubject(null,true);
  }
}

Fixed version (ground truth):
/** 
 * Removes the subject if it is empty, possibly converting back to SMS.
 */
private void removeSubjectIfEmpty(boolean notify){
  if (!hasSubject()) {
    setSubject(null,notify);
  }
}
Program: 44575
Project: 44575
Buggy source:
/** 
 * Force the message to be saved as MMS and return the Uri of the message. Typically used when handing a message off to another activity.
 */
public Uri saveAsMms(){
  if (DEBUG)   debug("String_Node_Str",mConversation);
  if (mDiscarded) {
    throw new IllegalStateException("String_Node_Str");
  }
  updateState(FORCE_MMS,true,false);
  prepareForSave();
  mConversation.ensureThreadId();
  mConversation.setDraftState(true);
  PduPersister persister=PduPersister.getPduPersister(mContext);
  SendReq sendReq=makeSendReq(mConversation,mSubject);
  if (mMessageUri == null) {
    mMessageUri=createDraftMmsMessage(persister,sendReq,mSlideshow);
  }
 else {
    updateDraftMmsMessage(mMessageUri,persister,mSlideshow,sendReq);
  }
  return mMessageUri;
}

Fixed version (ground truth):
/** 
 * Force the message to be saved as MMS and return the Uri of the message. Typically used when handing a message off to another activity.
 */
public Uri saveAsMms(){
  if (DEBUG)   debug("String_Node_Str",mConversation);
  if (mDiscarded) {
    throw new IllegalStateException("String_Node_Str");
  }
  updateState(FORCE_MMS,true,false);
  prepareForSave(true);
  mConversation.ensureThreadId();
  mConversation.setDraftState(true);
  PduPersister persister=PduPersister.getPduPersister(mContext);
  SendReq sendReq=makeSendReq(mConversation,mSubject);
  if (mMessageUri == null) {
    mMessageUri=createDraftMmsMessage(persister,sendReq,mSlideshow);
  }
 else {
    updateDraftMmsMessage(mMessageUri,persister,mSlideshow,sendReq);
  }
  return mMessageUri;
}
Program: 44576
Project: 44576
Buggy source:
/** 
 * Gets internal message state ready for storage.  Should be called any time the message is about to be sent or written to disk.
 */
private void prepareForSave(){
  syncWorkingRecipients();
  if (requiresMms()) {
    ensureSlideshow();
    syncTextToSlideshow();
    removeSubjectIfEmpty();
  }
}

Fixed version (ground truth):
/** 
 * Gets internal message state ready for storage.  Should be called any time the message is about to be sent or written to disk.
 */
private void prepareForSave(boolean notify){
  syncWorkingRecipients();
  if (requiresMms()) {
    ensureSlideshow();
    syncTextToSlideshow();
    removeSubjectIfEmpty(notify);
  }
}
Program: 44577
Project: 44577
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)) {
    debug("String_Node_Str");
  }
  prepareForSave();
  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;
}

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)) {
    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;
}
Program: 44578
Project: 44578
Buggy source:
/** 
 * Save this message as a draft in the conversation previously specified to   {@link setConversation}.
 */
public void saveDraft(){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    debug("String_Node_Str");
  }
  if (mDiscarded) {
    return;
  }
  if (mConversation == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  prepareForSave();
  if (requiresMms()) {
    asyncUpdateDraftMmsMessage(mConversation);
  }
 else {
    asyncUpdateDraftSmsMessage(mConversation,mText.toString());
  }
  mConversation.setDraftState(true);
}

Fixed version (ground truth):
/** 
 * Save this message as a draft in the conversation previously specified to   {@link setConversation}.
 */
public void saveDraft(){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    debug("String_Node_Str");
  }
  if (mDiscarded) {
    return;
  }
  if (mConversation == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  prepareForSave(false);
  if (requiresMms()) {
    asyncUpdateDraftMmsMessage(mConversation);
  }
 else {
    asyncUpdateDraftSmsMessage(mConversation,mText.toString());
  }
  mConversation.setDraftState(true);
}
Program: 44579
Project: 44579
Buggy source:
/** 
 * Removes the subject if it is empty, possibly converting back to SMS.
 */
private void removeSubjectIfEmpty(){
  if (!hasSubject()) {
    setSubject(null,true);
  }
}

Fixed version (ground truth):
/** 
 * Removes the subject if it is empty, possibly converting back to SMS.
 */
private void removeSubjectIfEmpty(boolean notify){
  if (!hasSubject()) {
    setSubject(null,notify);
  }
}
Program: 44580
Project: 44580
Buggy source:
/** 
 * Force the message to be saved as MMS and return the Uri of the message. Typically used when handing a message off to another activity.
 */
public Uri saveAsMms(){
  if (DEBUG)   debug("String_Node_Str",mConversation);
  if (mDiscarded) {
    throw new IllegalStateException("String_Node_Str");
  }
  updateState(FORCE_MMS,true,false);
  prepareForSave();
  mConversation.ensureThreadId();
  mConversation.setDraftState(true);
  PduPersister persister=PduPersister.getPduPersister(mContext);
  SendReq sendReq=makeSendReq(mConversation,mSubject);
  if (mMessageUri == null) {
    mMessageUri=createDraftMmsMessage(persister,sendReq,mSlideshow);
  }
 else {
    updateDraftMmsMessage(mMessageUri,persister,mSlideshow,sendReq);
  }
  return mMessageUri;
}

Fixed version (ground truth):
/** 
 * Force the message to be saved as MMS and return the Uri of the message. Typically used when handing a message off to another activity.
 */
public Uri saveAsMms(){
  if (DEBUG)   debug("String_Node_Str",mConversation);
  if (mDiscarded) {
    throw new IllegalStateException("String_Node_Str");
  }
  updateState(FORCE_MMS,true,false);
  prepareForSave(true);
  mConversation.ensureThreadId();
  mConversation.setDraftState(true);
  PduPersister persister=PduPersister.getPduPersister(mContext);
  SendReq sendReq=makeSendReq(mConversation,mSubject);
  if (mMessageUri == null) {
    mMessageUri=createDraftMmsMessage(persister,sendReq,mSlideshow);
  }
 else {
    updateDraftMmsMessage(mMessageUri,persister,mSlideshow,sendReq);
  }
  return mMessageUri;
}
Program: 44581
Project: 44581
Buggy source:
/** 
 * Gets internal message state ready for storage.  Should be called any time the message is about to be sent or written to disk.
 */
private void prepareForSave(){
  syncWorkingRecipients();
  if (requiresMms()) {
    ensureSlideshow();
    syncTextToSlideshow();
    removeSubjectIfEmpty();
  }
}

Fixed version (ground truth):
/** 
 * Gets internal message state ready for storage.  Should be called any time the message is about to be sent or written to disk.
 */
private void prepareForSave(boolean notify){
  syncWorkingRecipients();
  if (requiresMms()) {
    ensureSlideshow();
    syncTextToSlideshow();
    removeSubjectIfEmpty(notify);
  }
}
Program: 44582
Project: 44582
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)) {
    debug("String_Node_Str");
  }
  prepareForSave();
  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;
}

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)) {
    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;
}
Program: 44583
Project: 44583
Buggy source:
/** 
 * Save this message as a draft in the conversation previously specified to   {@link setConversation}.
 */
public void saveDraft(){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    debug("String_Node_Str");
  }
  if (mDiscarded) {
    return;
  }
  if (mConversation == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  prepareForSave();
  if (requiresMms()) {
    asyncUpdateDraftMmsMessage(mConversation);
  }
 else {
    asyncUpdateDraftSmsMessage(mConversation,mText.toString());
  }
  mConversation.setDraftState(true);
}

Fixed version (ground truth):
/** 
 * Save this message as a draft in the conversation previously specified to   {@link setConversation}.
 */
public void saveDraft(){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    debug("String_Node_Str");
  }
  if (mDiscarded) {
    return;
  }
  if (mConversation == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  prepareForSave(false);
  if (requiresMms()) {
    asyncUpdateDraftMmsMessage(mConversation);
  }
 else {
    asyncUpdateDraftSmsMessage(mConversation,mText.toString());
  }
  mConversation.setDraftState(true);
}
Program: 44584
Project: 44584
Buggy source:
public void run(){
  Contact c=Cache.get(number);
  if (c == null) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  if (handleLocalNumber(c))   return;
  ContactInfoCache cache=ContactInfoCache.getInstance();
  ContactInfoCache.CacheEntry entry=cache.getContactInfo(number);
synchronized (Cache.getInstance()) {
    if (contactChanged(c,entry)) {
      c.mName=entry.name;
      c.mNameAndNumber=formatNameAndNumber(c.mName,c.mNumber);
      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):
public void run(){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str");
  }
  for (  Contact c : contacts) {
    updateContact(c);
  }
}
Program: 44585
Project: 44585
Buggy source:
static Contact get(String number){
  if (Mms.isEmailAddress(number))   return getEmail(number);
synchronized (sInstance) {
    for (    Contact c : sInstance.mCache) {
      if (PhoneNumberUtils.compare(number,c.mNumber)) {
        return c;
      }
    }
    return null;
  }
}

Fixed version (ground truth):
static Contact get(String number){
  if (Mms.isEmailAddress(number))   return getEmail(number);
synchronized (sInstance) {
    for (    Contact c : sInstance.mCache) {
      if (AddressUtils.phoneNumbersEqual(number,c.mNumber)) {
        return c;
      }
    }
    return null;
  }
}
Program: 44586
Project: 44586
Buggy source:
private static void updateContact(final String number,boolean canBlock){
  Runnable r=new Runnable(){
    public void run(){
      Contact c=Cache.get(number);
      if (c == null) {
        Log.w(TAG,"String_Node_Str");
        return;
      }
      if (handleLocalNumber(c))       return;
      ContactInfoCache cache=ContactInfoCache.getInstance();
      ContactInfoCache.CacheEntry entry=cache.getContactInfo(number);
synchronized (Cache.getInstance()) {
        if (contactChanged(c,entry)) {
          c.mName=entry.name;
          c.mNameAndNumber=formatNameAndNumber(c.mName,c.mNumber);
          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);
          }
        }
      }
    }
  }
;
  if (canBlock) {
    r.run();
  }
 else {
    sTaskStack.push(r);
  }
}

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.mNameAndNumber=formatNameAndNumber(c.mName,c.mNumber);
      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);
      }
    }
  }
}
Program: 44587
Project: 44587
Buggy source:
public static void invalidateCache(){
  if (V)   Log.d(TAG,"String_Node_Str");
  ContactInfoCache.getInstance().invalidateCache();
  sTaskStack.clear();
  String[] numbersToUpdate=Cache.getNumbers();
  for (  String number : numbersToUpdate) {
    updateContact(number,false);
  }
}

Fixed version (ground truth):
public static void invalidateCache(){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str");
  }
  ContactInfoCache.getInstance().invalidateCache();
  sTaskStack.clear();
  asyncUpdateContacts(Cache.getContacts(),false);
}
Program: 44588
Project: 44588
Buggy source:
public SmsMessageSender(Context context,String[] dests,String msgText,long threadId){
  mContext=context;
  mMessageText=msgText;
  mNumberOfDests=dests.length;
  mDests=new String[mNumberOfDests];
  System.arraycopy(dests,0,mDests,0,mNumberOfDests);
  mTimestamp=System.currentTimeMillis();
  mThreadId=threadId;
  mServiceCenter=getOutgoingServiceCenter(mThreadId);
}

Fixed version (ground truth):
public SmsMessageSender(Context context,String[] dests,String msgText,long threadId){
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + threadId + "String_Node_Str");
    for (    String addr : dests) {
      log("String_Node_Str" + addr);
    }
  }
  mContext=context;
  mMessageText=msgText;
  mNumberOfDests=dests.length;
  mDests=new String[mNumberOfDests];
  System.arraycopy(dests,0,mDests,0,mNumberOfDests);
  mTimestamp=System.currentTimeMillis();
  mThreadId=threadId;
  mServiceCenter=getOutgoingServiceCenter(mThreadId);
}
Program: 44589
Project: 44589
Buggy source:
/** 
 * Helper method to verify which field has the focus
 * @param focused The view that should be focused (all others should not have focus)
 */
private void checkFocused(View focused){
  assertEquals(focused == mRecipientsView,mRecipientsView.isFocused());
  assertEquals(focused == mTextEditor,mTextEditor.isFocused());
}

Fixed version (ground truth):
/** 
 * Helper method to verify which field has the focus
 * @param focused The view that should be focused (all others should not have focus)
 */
@SmallTest private void checkFocused(View focused){
  assertEquals(focused == mRecipientsView,mRecipientsView.isFocused());
  assertEquals(focused == mTextEditor,mTextEditor.isFocused());
}
Program: 44590
Project: 44590
Buggy source:
public float getDur(){
  float dur=0;
  try {
    String durString=mSmilElement.getAttribute("String_Node_Str");
    if (durString != null) {
      dur=TimeImpl.parseClockValue(durString) / 1000f;
    }
  }
 catch (  IllegalArgumentException e) {
  }
  if (dur == 0) {
    dur=MmsConfig.getMinimumSlideElementDuration();
  }
  return dur;
}

Fixed version (ground truth):
public float getDur(){
  float dur=0;
  try {
    String durString=mSmilElement.getAttribute("String_Node_Str");
    if (durString != null) {
      dur=TimeImpl.parseClockValue(durString) / 1000f;
    }
  }
 catch (  IllegalArgumentException e) {
  }
  return dur;
}
Program: 44592
Project: 44592
Buggy source:
public void deliver(Context context,boolean isNew,int count,int uniqueThreads){
  updateNotification(context,mClickIntent,mDescription,mIconResourceId,isNew,mTicker,mTimeMillis,mTitle,count,uniqueThreads);
}

Fixed version (ground truth):
public void deliver(Context context,boolean isNew,int count,int uniqueThreads){
  updateNotification(context,mClickIntent,mDescription,mIconResourceId,isNew,(isNew ? mTicker : null),mTimeMillis,mTitle,count,uniqueThreads);
}
Program: 44593
Project: 44593
Buggy source:
public void run(){
  Contact c=Cache.get(number);
  if (c == null) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  if (handleLocalNumber(c))   return;
  ContactInfoCache cache=ContactInfoCache.getInstance();
  ContactInfoCache.CacheEntry entry=cache.getContactInfo(number);
synchronized (Cache.getInstance()) {
    if (contactChanged(c,entry)) {
      c.mName=entry.name;
      c.mNameAndNumber=formatNameAndNumber(c.mName,c.mNumber);
      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):
public void run(){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    log("String_Node_Str");
  }
  for (  Contact c : contacts) {
    updateContact(c);
  }
}
Program: 44594
Project: 44594
Buggy source:
static Contact get(String number){
  if (Mms.isEmailAddress(number))   return getEmail(number);
synchronized (sInstance) {
    for (    Contact c : sInstance.mCache) {
      if (PhoneNumberUtils.compare(number,c.mNumber)) {
        return c;
      }
    }
    return null;
  }
}

Fixed version (ground truth):
static Contact get(String number){
  if (Mms.isEmailAddress(number))   return getEmail(number);
synchronized (sInstance) {
    for (    Contact c : sInstance.mCache) {
      if (AddressUtils.phoneNumbersEqual(number,c.mNumber)) {
        return c;
      }
    }
    return null;
  }
}