nus-yam/ex-repair huggingface dataset:
Program: 44385
Project: 44385
Buggy source:
/** 
 * Copies your database from your local assets-folder to the recently created empty  database in the default application directory. From there it can be managed as always. The whole operation is done by transferring the bytestream.
 */
private void copyDB() throws IOException {
  Log.d(TAG,"String_Node_Str");
  final AssetManager assetManager=context.getAssets();
  String outFileName=DB_PATH + DatabaseContract.DATABASE_NAME;
  OutputStream myOutput=new FileOutputStream(outFileName);
  byte[] buffer=new byte[1024];
  int length;
  String[] fileList=assetManager.list("String_Node_Str");
  Arrays.sort(fileList);
  for (int i=0; i < MAX_CHUNK_COUNT; i++) {
    String fileName=String.format(DatabaseContract.DATABASE_NAME + "String_Node_Str",i);
    InputStream myInput=assetManager.open(fileName);
    while ((length=myInput.read(buffer)) > 0) {
      myOutput.write(buffer,0,length);
    }
    myInput.close();
  }
  myOutput.flush();
  myOutput.close();
}

Fixed version (ground truth):
/** 
 * Copies your database from your local assets-folder to the recently created empty  database in the default application directory. From there it can be managed as always. The whole operation is done by transferring the bytestream.
 */
private void copyDB() throws IOException {
  Log.d(TAG,"String_Node_Str");
  final AssetManager assetManager=context.getAssets();
  String outFileName=DB_PATH + DatabaseContract.DATABASE_NAME;
  OutputStream myOutput=new FileOutputStream(outFileName);
  byte[] buffer=new byte[1024];
  int length;
  String[] fileList=assetManager.list("String_Node_Str");
  Arrays.sort(fileList);
  for (int i=0; i < MAX_CHUNK_COUNT; i++) {
    String fileName=String.format(DatabaseContract.DATABASE_NAME + "String_Node_Str",i);
    if (Arrays.binarySearch(fileList,fileName) < 0)     break;
    InputStream myInput=assetManager.open(fileName);
    while ((length=myInput.read(buffer)) > 0) {
      myOutput.write(buffer,0,length);
    }
    myInput.close();
  }
  myOutput.flush();
  myOutput.close();
}
Program: 44386
Project: 44386
Buggy source:
private boolean updateMessageStatus(Context context,Uri messageUri,byte[] pdu){
  boolean isStatusReport=false;
  Cursor cursor=SqliteWrapper.query(context,context.getContentResolver(),messageUri,ID_PROJECTION,null,null,null);
  try {
    if (cursor.moveToFirst()) {
      int messageId=cursor.getInt(0);
      Uri updateUri=ContentUris.withAppendedId(STATUS_URI,messageId);
      SmsMessage message=SmsMessage.createFromPdu(pdu);
      int status=message.getStatus();
      isStatusReport=message.isStatusReportMessage();
      ContentValues contentValues=new ContentValues(1);
      if (Log.isLoggable(LogTag.TAG,Log.DEBUG)) {
        log("String_Node_Str" + messageUri + "String_Node_Str"+ status+ "String_Node_Str"+ isStatusReport);
      }
      contentValues.put(Sms.STATUS,status);
      SqliteWrapper.update(context,context.getContentResolver(),updateUri,contentValues,null,null);
    }
 else {
      error("String_Node_Str" + messageUri);
    }
  }
  finally {
    cursor.close();
  }
  return isStatusReport;
}

Fixed version (ground truth):
private SmsMessage updateMessageStatus(Context context,Uri messageUri,byte[] pdu){
  Cursor cursor=SqliteWrapper.query(context,context.getContentResolver(),messageUri,ID_PROJECTION,null,null,null);
  SmsMessage message=SmsMessage.createFromPdu(pdu);
  try {
    if (cursor.moveToFirst()) {
      int messageId=cursor.getInt(0);
      Uri updateUri=ContentUris.withAppendedId(STATUS_URI,messageId);
      int status=message.getStatus();
      boolean isStatusReport=message.isStatusReportMessage();
      ContentValues contentValues=new ContentValues(1);
      if (Log.isLoggable(LogTag.TAG,Log.DEBUG)) {
        log("String_Node_Str" + messageUri + "String_Node_Str"+ status+ "String_Node_Str"+ isStatusReport);
      }
      contentValues.put(Sms.STATUS,status);
      SqliteWrapper.update(context,context.getContentResolver(),updateUri,contentValues,null,null);
    }
 else {
      error("String_Node_Str" + messageUri);
    }
  }
  finally {
    cursor.close();
  }
  return message;
}
Program: 44387
Project: 44387
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  mContext=context;
  if (MESSAGE_STATUS_RECEIVED_ACTION.equals(intent.getAction())) {
    Uri messageUri=intent.getData();
    byte[] pdu=(byte[])intent.getExtra("String_Node_Str");
    boolean isStatusMessage=updateMessageStatus(context,messageUri,pdu);
    MessagingNotification.nonBlockingUpdateNewMessageIndicator(context,true,isStatusMessage);
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  mContext=context;
  if (MESSAGE_STATUS_RECEIVED_ACTION.equals(intent.getAction())) {
    Uri messageUri=intent.getData();
    byte[] pdu=(byte[])intent.getExtra("String_Node_Str");
    SmsMessage message=updateMessageStatus(context,messageUri,pdu);
    if (message.getStatus() < Sms.STATUS_PENDING)     MessagingNotification.nonBlockingUpdateNewMessageIndicator(context,true,message.isStatusReportMessage());
  }
}
Program: 44388
Project: 44388
Buggy source:
private boolean updateMessageStatus(Context context,Uri messageUri,byte[] pdu){
  boolean isStatusReport=false;
  Cursor cursor=SqliteWrapper.query(context,context.getContentResolver(),messageUri,ID_PROJECTION,null,null,null);
  try {
    if (cursor.moveToFirst()) {
      int messageId=cursor.getInt(0);
      Uri updateUri=ContentUris.withAppendedId(STATUS_URI,messageId);
      SmsMessage message=SmsMessage.createFromPdu(pdu);
      int status=message.getStatus();
      isStatusReport=message.isStatusReportMessage();
      ContentValues contentValues=new ContentValues(1);
      if (Log.isLoggable(LogTag.TAG,Log.DEBUG)) {
        log("String_Node_Str" + messageUri + "String_Node_Str"+ status+ "String_Node_Str"+ isStatusReport);
      }
      contentValues.put(Sms.STATUS,status);
      SqliteWrapper.update(context,context.getContentResolver(),updateUri,contentValues,null,null);
    }
 else {
      error("String_Node_Str" + messageUri);
    }
  }
  finally {
    cursor.close();
  }
  return isStatusReport;
}

Fixed version (ground truth):
private SmsMessage updateMessageStatus(Context context,Uri messageUri,byte[] pdu){
  Cursor cursor=SqliteWrapper.query(context,context.getContentResolver(),messageUri,ID_PROJECTION,null,null,null);
  SmsMessage message=SmsMessage.createFromPdu(pdu);
  try {
    if (cursor.moveToFirst()) {
      int messageId=cursor.getInt(0);
      Uri updateUri=ContentUris.withAppendedId(STATUS_URI,messageId);
      int status=message.getStatus();
      boolean isStatusReport=message.isStatusReportMessage();
      ContentValues contentValues=new ContentValues(1);
      if (Log.isLoggable(LogTag.TAG,Log.DEBUG)) {
        log("String_Node_Str" + messageUri + "String_Node_Str"+ status+ "String_Node_Str"+ isStatusReport);
      }
      contentValues.put(Sms.STATUS,status);
      SqliteWrapper.update(context,context.getContentResolver(),updateUri,contentValues,null,null);
    }
 else {
      error("String_Node_Str" + messageUri);
    }
  }
  finally {
    cursor.close();
  }
  return message;
}
Program: 44389
Project: 44389
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  mContext=context;
  if (MESSAGE_STATUS_RECEIVED_ACTION.equals(intent.getAction())) {
    Uri messageUri=intent.getData();
    byte[] pdu=(byte[])intent.getExtra("String_Node_Str");
    boolean isStatusMessage=updateMessageStatus(context,messageUri,pdu);
    MessagingNotification.nonBlockingUpdateNewMessageIndicator(context,true,isStatusMessage);
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  mContext=context;
  if (MESSAGE_STATUS_RECEIVED_ACTION.equals(intent.getAction())) {
    Uri messageUri=intent.getData();
    byte[] pdu=(byte[])intent.getExtra("String_Node_Str");
    SmsMessage message=updateMessageStatus(context,messageUri,pdu);
    if (message.getStatus() < Sms.STATUS_PENDING)     MessagingNotification.nonBlockingUpdateNewMessageIndicator(context,true,message.isStatusReportMessage());
  }
}
Program: 44390
Project: 44390
Buggy source:
@Override protected void onListItemClick(ListView l,View v,int position,long id){
  if (LOCAL_LOGV) {
    Log.v(TAG,"String_Node_Str" + position + "String_Node_Str"+ id);
  }
  if (position == 0) {
    createNewMessage();
  }
 else   if (v instanceof ConversationListItem) {
    ConversationListItem headerView=(ConversationListItem)v;
    ConversationListItemData ch=headerView.getConversationHeader();
    openThread(ch.getThreadId());
  }
}

Fixed version (ground truth):
@Override protected void onListItemClick(ListView l,View v,int position,long id){
  if (LOCAL_LOGV) {
    Log.v(TAG,"String_Node_Str" + position + "String_Node_Str"+ id);
  }
  if (position == 0) {
    createNewMessage();
  }
 else {
    Cursor cursor=(Cursor)getListView().getItemAtPosition(position);
    Conversation conv=Conversation.from(this,cursor);
    long tid=conv.getThreadId();
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str" + position + "String_Node_Str"+ v+ "String_Node_Str"+ tid);
    }
    openThread(tid);
  }
}
Program: 44391
Project: 44391
Buggy source:
@Override protected void onListItemClick(ListView l,View v,int position,long id){
  if (LOCAL_LOGV) {
    Log.v(TAG,"String_Node_Str" + position + "String_Node_Str"+ id);
  }
  if (position == 0) {
    createNewMessage();
  }
 else {
    Cursor cursor=(Cursor)getListView().getItemAtPosition(position);
    Conversation conv=Conversation.from(this,cursor);
    long tid=conv.getThreadId();
    if (LogTag.VERBOSE) {
      Log.d(TAG,"String_Node_Str" + position + "String_Node_Str"+ v+ "String_Node_Str"+ tid);
    }
    openThread(tid);
  }
}

Fixed version (ground truth):
@Override protected void onListItemClick(ListView l,View v,int position,long id){
  if (LOCAL_LOGV) {
    Log.v(TAG,"String_Node_Str" + position + "String_Node_Str"+ id);
  }
  if (position == 0) {
    createNewMessage();
  }
 else {
    Cursor cursor=(Cursor)getListView().getItemAtPosition(position);
    Conversation conv=Conversation.from(this,cursor);
    long tid=conv.getThreadId();
    openThread(tid);
  }
}
Program: 44392
Project: 44392
Buggy source:
@Override protected void onListItemClick(ListView l,View v,int position,long id){
  if (LOCAL_LOGV) {
    Log.v(TAG,"String_Node_Str" + position + "String_Node_Str"+ id);
  }
  if (position == 0) {
    createNewMessage();
  }
 else   if (v instanceof ConversationListItem) {
    ConversationListItem headerView=(ConversationListItem)v;
    ConversationListItemData ch=headerView.getConversationHeader();
    openThread(ch.getThreadId());
  }
}

Fixed version (ground truth):
@Override protected void onListItemClick(ListView l,View v,int position,long id){
  if (LOCAL_LOGV) {
    Log.v(TAG,"String_Node_Str" + position + "String_Node_Str"+ id);
  }
  if (position == 0) {
    createNewMessage();
  }
 else {
    Cursor cursor=(Cursor)getListView().getItemAtPosition(position);
    Conversation conv=Conversation.from(this,cursor);
    long tid=conv.getThreadId();
    openThread(tid);
  }
}
Program: 44393
Project: 44393
Buggy source:
@Override protected void onListItemClick(ListView l,View v,int position,long id){
  if (position == 0) {
    createNewMessage();
  }
 else   if (v instanceof ConversationListItem) {
    ConversationListItem headerView=(ConversationListItem)v;
    ConversationListItemData ch=headerView.getConversationHeader();
    long threadId=ch.getThreadId();
    if (LogTag.VERBOSE) {
      Log.d(TAG,"String_Node_Str" + v + "String_Node_Str"+ position+ "String_Node_Str"+ id+ "String_Node_Str"+ threadId);
    }
    openThread(threadId);
  }
}

Fixed version (ground truth):
@Override protected void onListItemClick(ListView l,View v,int position,long id){
  if (position == 0) {
    createNewMessage();
  }
 else {
    Cursor cursor=(Cursor)getListView().getItemAtPosition(position);
    Conversation conv=Conversation.from(this,cursor);
    long tid=conv.getThreadId();
    if (LogTag.VERBOSE) {
      Log.d(TAG,"String_Node_Str" + position + "String_Node_Str"+ v+ "String_Node_Str"+ tid);
    }
    openThread(tid);
  }
}
Program: 44394
Project: 44394
Buggy source:
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  mSentMessage=false;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId,false);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri,false);
    }
  }
  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=0;
  if (conversation != null) {
    conversation.blockMarkAsRead(true);
    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();
  }
}

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

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

Fixed version (ground truth):
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  mSentMessage=false;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId,false);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri,false);
    }
  }
  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 (conversation != null) {
    conversation.blockMarkAsRead(true);
    sameThread=(conversation.getThreadId() == mConversation.getThreadId() && conversation.equals(mConversation));
  }
  if (sameThread) {
    log("String_Node_Str");
  }
 else {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      log("String_Node_Str");
    }
    saveDraft();
    initialize(null);
    loadMessageContent();
  }
}
Program: 44397
Project: 44397
Buggy source:
/** 
 * Marks all messages in this conversation as read and updates relevant notifications.  This method returns immediately; work is dispatched to a background thread.
 */
public void markAsRead(){
  final Uri threadUri=getUri();
  new Thread(new Runnable(){
    public void run(){
synchronized (mMarkAsBlockedSyncer) {
        if (mMarkAsReadBlocked) {
          try {
            mMarkAsBlockedSyncer.wait();
          }
 catch (          InterruptedException e) {
          }
        }
        if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
          LogTag.debug("String_Node_Str" + threadUri);
        }
        if (threadUri != null) {
          buildReadContentValues();
          mHasUnreadMessages=true;
          Cursor c=mContext.getContentResolver().query(threadUri,READ_PROJECTION,"String_Node_Str",null,null);
          if (c != null) {
            try {
              mHasUnreadMessages=c.getCount() > 0;
            }
  finally {
              c.close();
            }
          }
          if (mHasUnreadMessages) {
            mContext.getContentResolver().update(threadUri,mReadContentValues,"String_Node_Str",null);
          }
        }
      }
      MessagingNotification.blockingUpdateAllNotifications(mContext);
    }
  }
).start();
}

Fixed version (ground truth):
/** 
 * Marks all messages in this conversation as read and updates relevant notifications.  This method returns immediately; work is dispatched to a background thread.
 */
public void markAsRead(){
  final Uri threadUri=getUri();
  new Thread(new Runnable(){
    public void run(){
synchronized (mMarkAsBlockedSyncer) {
        if (mMarkAsReadBlocked) {
          try {
            mMarkAsBlockedSyncer.wait();
          }
 catch (          InterruptedException e) {
          }
        }
        if (threadUri != null) {
          buildReadContentValues();
          boolean needUpdate=true;
          Cursor c=mContext.getContentResolver().query(threadUri,UNREAD_PROJECTION,UNREAD_SELECTION,null,null);
          if (c != null) {
            try {
              needUpdate=c.getCount() > 0;
            }
  finally {
              c.close();
            }
          }
          if (needUpdate) {
            LogTag.debug("String_Node_Str" + threadUri);
            mContext.getContentResolver().update(threadUri,mReadContentValues,UNREAD_SELECTION,null);
          }
          setHasUnreadMessages(false);
        }
      }
      MessagingNotification.blockingUpdateAllNotifications(mContext);
    }
  }
).start();
}
Program: 44398
Project: 44398
Buggy source:
/** 
 * Returns true if there are any unread messages in the conversation.
 */
public synchronized boolean hasUnreadMessages(){
  return mHasUnreadMessages;
}

Fixed version (ground truth):
/** 
 * Returns true if there are any unread messages in the conversation.
 */
public boolean hasUnreadMessages(){
synchronized (this) {
    return mHasUnreadMessages;
  }
}
Program: 44399
Project: 44399
Buggy source:
/** 
 * Fill the specified conversation with the values from the specified cursor, possibly setting recipients to empty if   {@value allowQuery}is false and the recipient IDs are not in cache.  The cursor should be one made via   {@link #startQueryForAll}.
 */
private static void fillFromCursor(Context context,Conversation conv,Cursor c,boolean allowQuery){
synchronized (conv) {
    conv.mThreadId=c.getLong(ID);
    conv.mDate=c.getLong(DATE);
    conv.mMessageCount=c.getInt(MESSAGE_COUNT);
    String snippet=MessageUtils.extractEncStrFromCursor(c,SNIPPET,SNIPPET_CS);
    if (TextUtils.isEmpty(snippet)) {
      snippet=context.getString(R.string.no_subject_view);
    }
    conv.mSnippet=snippet;
    conv.mHasUnreadMessages=(c.getInt(READ) == 0);
    conv.mHasError=(c.getInt(ERROR) != 0);
    conv.mHasAttachment=(c.getInt(HAS_ATTACHMENT) != 0);
  }
  String recipientIds=c.getString(RECIPIENT_IDS);
  ContactList recipients=ContactList.getByIds(recipientIds,allowQuery);
synchronized (conv) {
    conv.mRecipients=recipients;
  }
  if (Log.isLoggable(LogTag.THREAD_CACHE,Log.VERBOSE)) {
    LogTag.debug("String_Node_Str" + conv + "String_Node_Str"+ recipientIds);
  }
}

Fixed version (ground truth):
/** 
 * Fill the specified conversation with the values from the specified cursor, possibly setting recipients to empty if   {@value allowQuery}is false and the recipient IDs are not in cache.  The cursor should be one made via   {@link #startQueryForAll}.
 */
private static void fillFromCursor(Context context,Conversation conv,Cursor c,boolean allowQuery){
synchronized (conv) {
    conv.mThreadId=c.getLong(ID);
    conv.mDate=c.getLong(DATE);
    conv.mMessageCount=c.getInt(MESSAGE_COUNT);
    String snippet=MessageUtils.extractEncStrFromCursor(c,SNIPPET,SNIPPET_CS);
    if (TextUtils.isEmpty(snippet)) {
      snippet=context.getString(R.string.no_subject_view);
    }
    conv.mSnippet=snippet;
    conv.setHasUnreadMessages(c.getInt(READ) == 0);
    conv.mHasError=(c.getInt(ERROR) != 0);
    conv.mHasAttachment=(c.getInt(HAS_ATTACHMENT) != 0);
  }
  String recipientIds=c.getString(RECIPIENT_IDS);
  ContactList recipients=ContactList.getByIds(recipientIds,allowQuery);
synchronized (conv) {
    conv.mRecipients=recipients;
  }
  if (Log.isLoggable(LogTag.THREAD_CACHE,Log.VERBOSE)) {
    LogTag.debug("String_Node_Str" + conv + "String_Node_Str"+ recipientIds);
  }
}
Program: 44400
Project: 44400
Buggy source:
private static final MmsSmsNotificationInfo getMmsNewMessageNotificationInfo(Context context,Set<Long> threads){
  ContentResolver resolver=context.getContentResolver();
  Cursor cursor=SqliteWrapper.query(context,resolver,Mms.CONTENT_URI,MMS_STATUS_PROJECTION,NEW_INCOMING_MM_CONSTRAINT,null,Mms.DATE + "String_Node_Str");
  if (cursor == null) {
    return null;
  }
  try {
    if (!cursor.moveToFirst()) {
      return null;
    }
    long msgId=cursor.getLong(COLUMN_MMS_ID);
    Uri msgUri=Mms.CONTENT_URI.buildUpon().appendPath(Long.toString(msgId)).build();
    String address=AddressUtils.getFrom(context,msgUri);
    String subject=getMmsSubject(cursor.getString(COLUMN_SUBJECT),cursor.getInt(COLUMN_SUBJECT_CS));
    long threadId=cursor.getLong(COLUMN_THREAD_ID);
    long timeMillis=cursor.getLong(COLUMN_DATE) * 1000;
    MmsSmsNotificationInfo info=getNewMessageNotificationInfo(address,subject,context,R.drawable.stat_notify_mms,null,threadId,timeMillis,cursor.getCount());
    threads.add(threadId);
    while (cursor.moveToNext()) {
      threads.add(cursor.getLong(COLUMN_THREAD_ID));
    }
    return info;
  }
  finally {
    cursor.close();
  }
}

Fixed version (ground truth):
private static final MmsSmsNotificationInfo getMmsNewMessageNotificationInfo(Context context,Set<Long> threads){
  ContentResolver resolver=context.getContentResolver();
  Cursor cursor=SqliteWrapper.query(context,resolver,Mms.CONTENT_URI,MMS_STATUS_PROJECTION,NEW_INCOMING_MM_CONSTRAINT,null,Mms.DATE + "String_Node_Str");
  if (cursor == null) {
    return null;
  }
  try {
    if (!cursor.moveToFirst()) {
      return null;
    }
    long msgId=cursor.getLong(COLUMN_MMS_ID);
    Uri msgUri=Mms.CONTENT_URI.buildUpon().appendPath(Long.toString(msgId)).build();
    String address=AddressUtils.getFrom(context,msgUri);
    String subject=getMmsSubject(cursor.getString(COLUMN_SUBJECT),cursor.getInt(COLUMN_SUBJECT_CS));
    long threadId=cursor.getLong(COLUMN_THREAD_ID);
    long timeMillis=cursor.getLong(COLUMN_DATE) * 1000;
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      Log.d(TAG,"String_Node_Str" + cursor.getCount() + "String_Node_Str"+ address+ "String_Node_Str"+ threadId);
    }
    MmsSmsNotificationInfo info=getNewMessageNotificationInfo(address,subject,context,R.drawable.stat_notify_mms,null,threadId,timeMillis,cursor.getCount());
    threads.add(threadId);
    while (cursor.moveToNext()) {
      threads.add(cursor.getLong(COLUMN_THREAD_ID));
    }
    return info;
  }
  finally {
    cursor.close();
  }
}
Program: 44401
Project: 44401
Buggy source:
private static final MmsSmsNotificationInfo getSmsNewMessageNotificationInfo(Context context,Set<Long> threads){
  ContentResolver resolver=context.getContentResolver();
  Cursor cursor=SqliteWrapper.query(context,resolver,Sms.CONTENT_URI,SMS_STATUS_PROJECTION,NEW_INCOMING_SM_CONSTRAINT,null,Sms.DATE + "String_Node_Str");
  if (cursor == null) {
    return null;
  }
  try {
    if (!cursor.moveToFirst()) {
      return null;
    }
    String address=cursor.getString(COLUMN_SMS_ADDRESS);
    String body=cursor.getString(COLUMN_SMS_BODY);
    long threadId=cursor.getLong(COLUMN_THREAD_ID);
    long timeMillis=cursor.getLong(COLUMN_DATE);
    MmsSmsNotificationInfo info=getNewMessageNotificationInfo(address,body,context,R.drawable.stat_notify_sms,null,threadId,timeMillis,cursor.getCount());
    threads.add(threadId);
    while (cursor.moveToNext()) {
      threads.add(cursor.getLong(COLUMN_THREAD_ID));
    }
    return info;
  }
  finally {
    cursor.close();
  }
}

Fixed version (ground truth):
private static final MmsSmsNotificationInfo getSmsNewMessageNotificationInfo(Context context,Set<Long> threads){
  ContentResolver resolver=context.getContentResolver();
  Cursor cursor=SqliteWrapper.query(context,resolver,Sms.CONTENT_URI,SMS_STATUS_PROJECTION,NEW_INCOMING_SM_CONSTRAINT,null,Sms.DATE + "String_Node_Str");
  if (cursor == null) {
    return null;
  }
  try {
    if (!cursor.moveToFirst()) {
      return null;
    }
    String address=cursor.getString(COLUMN_SMS_ADDRESS);
    String body=cursor.getString(COLUMN_SMS_BODY);
    long threadId=cursor.getLong(COLUMN_THREAD_ID);
    long timeMillis=cursor.getLong(COLUMN_DATE);
{
      Log.d(TAG,"String_Node_Str" + cursor.getCount() + "String_Node_Str"+ address+ "String_Node_Str"+ threadId);
    }
    MmsSmsNotificationInfo info=getNewMessageNotificationInfo(address,body,context,R.drawable.stat_notify_sms,null,threadId,timeMillis,cursor.getCount());
    threads.add(threadId);
    while (cursor.moveToNext()) {
      threads.add(cursor.getLong(COLUMN_THREAD_ID));
    }
    return info;
  }
  finally {
    cursor.close();
  }
}
Program: 44402
Project: 44402
Buggy source:
/** 
 * Checks to see if there are any "unseen" messages or delivery reports.  Shows the most recent notification if there is one.
 * @param context the context to use
 * @param isNew if notify a new message comes, it should be true, otherwise, false.
 */
public static void blockingUpdateNewMessageIndicator(Context context,boolean isNew,boolean isStatusMessage){
  SortedSet<MmsSmsNotificationInfo> accumulator=new TreeSet<MmsSmsNotificationInfo>(INFO_COMPARATOR);
  MmsSmsDeliveryInfo delivery=null;
  Set<Long> threads=new HashSet<Long>(4);
  int count=0;
  count+=accumulateNotificationInfo(accumulator,getMmsNewMessageNotificationInfo(context,threads));
  count+=accumulateNotificationInfo(accumulator,getSmsNewMessageNotificationInfo(context,threads));
  cancelNotification(context,NOTIFICATION_ID);
  if (!accumulator.isEmpty()) {
    accumulator.first().deliver(context,isNew,count,threads.size());
  }
  delivery=getSmsNewDeliveryInfo(context);
  if (delivery != null) {
    delivery.deliver(context,isStatusMessage);
  }
}

Fixed version (ground truth):
/** 
 * Checks to see if there are any "unseen" messages or delivery reports.  Shows the most recent notification if there is one.
 * @param context the context to use
 * @param isNew if notify a new message comes, it should be true, otherwise, false.
 */
public static void blockingUpdateNewMessageIndicator(Context context,boolean isNew,boolean isStatusMessage){
  SortedSet<MmsSmsNotificationInfo> accumulator=new TreeSet<MmsSmsNotificationInfo>(INFO_COMPARATOR);
  MmsSmsDeliveryInfo delivery=null;
  Set<Long> threads=new HashSet<Long>(4);
  int count=0;
  count+=accumulateNotificationInfo(accumulator,getMmsNewMessageNotificationInfo(context,threads));
  count+=accumulateNotificationInfo(accumulator,getSmsNewMessageNotificationInfo(context,threads));
  cancelNotification(context,NOTIFICATION_ID);
  if (!accumulator.isEmpty()) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      Log.d(TAG,"String_Node_Str" + count + "String_Node_Str"+ isNew);
    }
    accumulator.first().deliver(context,isNew,count,threads.size());
  }
  delivery=getSmsNewDeliveryInfo(context);
  if (delivery != null) {
    delivery.deliver(context,isStatusMessage);
  }
}
Program: 44404
Project: 44404
Buggy source:
private void drawRightStatusIndicator(MessageItem msgItem){
  if (msgItem.mLocked) {
    mLockedIndicator.setImageResource(R.drawable.ic_lock_message_sms);
    mLockedIndicator.setVisibility(View.VISIBLE);
  }
 else {
    mLockedIndicator.setVisibility(View.GONE);
  }
  if (msgItem.isOutgoingMessage() && msgItem.isFailedMessage()) {
    mDeliveredIndicator.setImageResource(R.drawable.ic_sms_mms_not_delivered);
    setErrorIndicatorClickListener(msgItem);
    mDeliveredIndicator.setVisibility(View.VISIBLE);
  }
 else   if (msgItem.mDeliveryStatus == MessageItem.DeliveryStatus.FAILED) {
    mDeliveredIndicator.setImageResource(R.drawable.ic_sms_mms_not_delivered);
    mDeliveredIndicator.setVisibility(View.VISIBLE);
  }
 else   if (msgItem.mDeliveryStatus == MessageItem.DeliveryStatus.RECEIVED) {
    mDeliveredIndicator.setImageResource(R.drawable.ic_sms_mms_delivered);
    mDeliveredIndicator.setVisibility(View.VISIBLE);
  }
 else {
    mDeliveredIndicator.setVisibility(View.GONE);
  }
  if (msgItem.mDeliveryStatus == MessageItem.DeliveryStatus.INFO || msgItem.mReadReport) {
    mDetailsIndicator.setImageResource(R.drawable.ic_sms_mms_details);
    mDetailsIndicator.setVisibility(View.VISIBLE);
  }
 else {
    mDetailsIndicator.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
private void drawRightStatusIndicator(MessageItem msgItem){
  if (msgItem.mLocked) {
    mLockedIndicator.setImageResource(R.drawable.ic_lock_message_sms);
    mLockedIndicator.setVisibility(View.VISIBLE);
  }
 else {
    mLockedIndicator.setVisibility(View.GONE);
  }
  if (msgItem.isOutgoingMessage() && msgItem.isFailedMessage()) {
    mDeliveredIndicator.setImageResource(R.drawable.ic_list_alert_sms_failed);
    setErrorIndicatorClickListener(msgItem);
    mDeliveredIndicator.setVisibility(View.VISIBLE);
  }
 else   if (msgItem.mDeliveryStatus == MessageItem.DeliveryStatus.FAILED) {
    mDeliveredIndicator.setImageResource(R.drawable.ic_list_alert_sms_failed);
    mDeliveredIndicator.setVisibility(View.VISIBLE);
  }
 else   if (msgItem.mDeliveryStatus == MessageItem.DeliveryStatus.RECEIVED) {
    mDeliveredIndicator.setImageResource(R.drawable.ic_sms_mms_delivered);
    mDeliveredIndicator.setVisibility(View.VISIBLE);
  }
 else {
    mDeliveredIndicator.setVisibility(View.GONE);
  }
  if (msgItem.mDeliveryStatus == MessageItem.DeliveryStatus.INFO || msgItem.mReadReport) {
    mDetailsIndicator.setImageResource(R.drawable.ic_sms_mms_details);
    mDetailsIndicator.setVisibility(View.VISIBLE);
  }
 else {
    mDetailsIndicator.setVisibility(View.GONE);
  }
}
Program: 44405
Project: 44405
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,false);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri,false);
    }
  }
  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=0;
  if (conversation != null) {
    conversation.blockMarkAsRead(true);
    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();
  }
}

Fixed version (ground truth):
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  mSentMessage=false;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId,false);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri,false);
    }
  }
  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=0;
  if (conversation != null) {
    conversation.blockMarkAsRead(true);
    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: 44406
Project: 44406
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,false);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri,false);
    }
  }
  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=0;
  if (conversation != null) {
    conversation.blockMarkAsRead(true);
    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();
  }
}

Fixed version (ground truth):
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  Conversation conversation=null;
  mSentMessage=false;
  long threadId=intent.getLongExtra("String_Node_Str",0);
  Uri intentUri=intent.getData();
  boolean sameThread=false;
  if (threadId > 0) {
    conversation=Conversation.get(this,threadId,false);
  }
 else {
    if (mConversation.getThreadId() == 0) {
      mWorkingMessage.syncWorkingRecipients();
      sameThread=mConversation.sameRecipient(intentUri);
    }
    if (!sameThread) {
      conversation=Conversation.get(this,intentUri,false);
    }
  }
  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=0;
  if (conversation != null) {
    conversation.blockMarkAsRead(true);
    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: 44407
Project: 44407
Buggy source:
public void run(){
  cacheAllThreads(context);
}

Fixed version (ground truth):
public void run(){
  blockingMarkAllSmsMessagesAsSeen(context);
  blockingMarkAllMmsMessagesAsSeen(context);
  MessagingNotification.blockingUpdateAllNotifications(context);
}
Program: 44408
Project: 44408
Buggy source:
/** 
 * Marks all messages in this conversation as read and updates relevant notifications.  This method returns immediately; work is dispatched to a background thread.
 */
public void markAsRead(){
  final Uri threadUri=getUri();
  new Thread(new Runnable(){
    public void run(){
synchronized (mMarkAsBlockedSyncer) {
        if (mMarkAsReadBlocked) {
          try {
            mMarkAsBlockedSyncer.wait();
          }
 catch (          InterruptedException e) {
          }
        }
        if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
          LogTag.debug("String_Node_Str" + threadUri);
        }
        if (threadUri != null) {
          buildReadContentValues();
          mHasUnreadMessages=true;
          Cursor c=mContext.getContentResolver().query(threadUri,READ_PROJECTION,"String_Node_Str",null,null);
          if (c != null) {
            try {
              mHasUnreadMessages=c.getCount() > 0;
            }
  finally {
              c.close();
            }
          }
          if (mHasUnreadMessages) {
            mContext.getContentResolver().update(threadUri,mReadContentValues,"String_Node_Str",null);
          }
        }
      }
      MessagingNotification.updateAllNotifications(mContext);
    }
  }
).start();
}

Fixed version (ground truth):
/** 
 * Marks all messages in this conversation as read and updates relevant notifications.  This method returns immediately; work is dispatched to a background thread.
 */
public void markAsRead(){
  final Uri threadUri=getUri();
  new Thread(new Runnable(){
    public void run(){
synchronized (mMarkAsBlockedSyncer) {
        if (mMarkAsReadBlocked) {
          try {
            mMarkAsBlockedSyncer.wait();
          }
 catch (          InterruptedException e) {
          }
        }
        if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
          LogTag.debug("String_Node_Str" + threadUri);
        }
        if (threadUri != null) {
          buildReadContentValues();
          mHasUnreadMessages=true;
          Cursor c=mContext.getContentResolver().query(threadUri,READ_PROJECTION,"String_Node_Str",null,null);
          if (c != null) {
            try {
              mHasUnreadMessages=c.getCount() > 0;
            }
  finally {
              c.close();
            }
          }
          if (mHasUnreadMessages) {
            mContext.getContentResolver().update(threadUri,mReadContentValues,"String_Node_Str",null);
          }
        }
      }
      MessagingNotification.blockingUpdateAllNotifications(mContext);
    }
  }
).start();
}
Program: 44409
Project: 44409
Buggy source:
/** 
 * Returns a temporary Conversation (not representing one on disk) wrapping the contents of the provided cursor.  The cursor should be the one returned to your AsyncQueryHandler passed in to   {@link startQueryForAll}. The recipient list of this conversation can be empty if the results were not in cache.
 */
public static Conversation from(Context context,Cursor cursor){
  return new Conversation(context,cursor,false);
}

Fixed version (ground truth):
/** 
 * Returns a temporary Conversation (not representing one on disk) wrapping the contents of the provided cursor.  The cursor should be the one returned to your AsyncQueryHandler passed in to   {@link #startQueryForAll}. The recipient list of this conversation can be empty if the results were not in cache.
 */
public static Conversation from(Context context,Cursor cursor){
  return new Conversation(context,cursor,false);
}
Program: 44410
Project: 44410
Buggy source:
/** 
 * Create a new conversation with no recipients.    {@link setRecipients} canbe called as many times as you like; the conversation will not be created in the database until  {@link ensureThreadId} is called.
 */
public static Conversation createNew(Context context){
  return new Conversation(context);
}

Fixed version (ground truth):
/** 
 * Create a new conversation with no recipients.    {@link #setRecipients} canbe called as many times as you like; the conversation will not be created in the database until  {@link #ensureThreadId} is called.
 */
public static Conversation createNew(Context context){
  return new Conversation(context);
}
Program: 44411
Project: 44411
Buggy source:
private void buildReadContentValues(){
  if (mReadContentValues == null) {
    mReadContentValues=new ContentValues(1);
    mReadContentValues.put("String_Node_Str",1);
  }
}

Fixed version (ground truth):
private void buildReadContentValues(){
  if (mReadContentValues == null) {
    mReadContentValues=new ContentValues(2);
    mReadContentValues.put("String_Node_Str",1);
    mReadContentValues.put("String_Node_Str",1);
  }
}
Program: 44412
Project: 44412
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;
}