nus-yam/ex-repair huggingface dataset:
Program: 44488
Project: 44488
Buggy source:
private static long getOrCreateThreadId(Context context,ContactList list){
  HashSet<String> recipients=new HashSet<String>();
  Contact cacheContact=null;
  for (  Contact c : list) {
    cacheContact=Contact.get(c.getNumber(),true);
    if (cacheContact != null) {
      recipients.add(cacheContact.getNumber());
    }
 else {
      recipients.add(c.getNumber());
    }
  }
  return Threads.getOrCreateThreadId(context,recipients);
}

Fixed version (ground truth):
private static long getOrCreateThreadId(Context context,ContactList list){
  HashSet<String> recipients=new HashSet<String>();
  Contact cacheContact=null;
  for (  Contact c : list) {
    cacheContact=Contact.get(c.getNumber(),true);
    if (cacheContact != null) {
      recipients.add(cacheContact.getNumber());
    }
 else {
      recipients.add(c.getNumber());
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    LogTag.debug("String_Node_Str",recipients);
  }
  return Threads.getOrCreateThreadId(context,recipients);
}
Program: 44489
Project: 44489
Buggy source:
static void dumpCache(){
  if (DEBUG) {
synchronized (sInstance) {
      Log.v(TAG,"String_Node_Str");
      for (      Conversation c : sInstance.mCache) {
        Log.v(TAG,"String_Node_Str" + c + "String_Node_Str"+ c.getThreadId()+ "String_Node_Str"+ c.hashCode());
      }
    }
  }
}

Fixed version (ground truth):
static void dumpCache(){
  if (DEBUG) {
synchronized (sInstance) {
      LogTag.debug("String_Node_Str");
      for (      Conversation c : sInstance.mCache) {
        LogTag.debug("String_Node_Str" + c + "String_Node_Str"+ c.getThreadId()+ "String_Node_Str"+ c.hashCode());
      }
    }
  }
}
Program: 44490
Project: 44490
Buggy source:
/** 
 * Put the specified conversation in the cache.  The caller should not place an already-existing conversation in the cache, but rather update it in place.
 */
static void put(Conversation c){
synchronized (sInstance) {
    if (DEBUG) {
      Log.v(TAG,"String_Node_Str" + c + "String_Node_Str"+ c.getThreadId()+ "String_Node_Str"+ c.hashCode());
      dumpCache();
    }
    if (sInstance.mCache.contains(c)) {
      throw new IllegalStateException("String_Node_Str" + c + "String_Node_Str"+ c.mThreadId);
    }
    sInstance.mCache.add(c);
  }
}

Fixed version (ground truth):
/** 
 * Put the specified conversation in the cache.  The caller should not place an already-existing conversation in the cache, but rather update it in place.
 */
static void put(Conversation c){
synchronized (sInstance) {
    if (DEBUG) {
      LogTag.debug("String_Node_Str" + c + "String_Node_Str"+ c.getThreadId()+ "String_Node_Str"+ c.hashCode());
      dumpCache();
    }
    if (sInstance.mCache.contains(c)) {
      throw new IllegalStateException("String_Node_Str" + c + "String_Node_Str"+ c.mThreadId);
    }
    sInstance.mCache.add(c);
  }
}
Program: 44491
Project: 44491
Buggy source:
static void remove(long threadId){
  if (DEBUG) {
    Log.v(TAG,"String_Node_Str" + threadId);
    dumpCache();
  }
  for (  Conversation c : sInstance.mCache) {
    if (c.getThreadId() == threadId) {
      sInstance.mCache.remove(c);
      return;
    }
  }
}

Fixed version (ground truth):
static void remove(long threadId){
  if (DEBUG) {
    LogTag.debug("String_Node_Str" + threadId);
    dumpCache();
  }
  for (  Conversation c : sInstance.mCache) {
    if (c.getThreadId() == threadId) {
      sInstance.mCache.remove(c);
      return;
    }
  }
}
Program: 44492
Project: 44492
Buggy source:
/** 
 * Return the conversation with the specified recipient list, or null if it's not in cache.
 */
static Conversation get(ContactList list){
synchronized (sInstance) {
    if (DEBUG) {
      Log.v(TAG,"String_Node_Str" + list);
      dumpCache();
    }
    for (    Conversation c : sInstance.mCache) {
      if (c.getRecipients().equals(list)) {
        return c;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return the conversation with the specified recipient list, or null if it's not in cache.
 */
static Conversation get(ContactList list){
synchronized (sInstance) {
    if (DEBUG) {
      LogTag.debug("String_Node_Str" + list);
      dumpCache();
    }
    for (    Conversation c : sInstance.mCache) {
      if (c.getRecipients().equals(list)) {
        return c;
      }
    }
  }
  return null;
}
Program: 44493
Project: 44493
Buggy source:
private static void cacheAllThreads(Context context){
synchronized (Cache.getInstance()) {
    if (DEBUG) {
      Log.v(TAG,"String_Node_Str");
    }
    HashSet<Long> threadsOnDisk=new HashSet<Long>();
    Cursor c=context.getContentResolver().query(sAllThreadsUri,ALL_THREADS_PROJECTION,null,null,null);
    try {
      while (c.moveToNext()) {
        long threadId=c.getLong(ID);
        threadsOnDisk.add(threadId);
        Conversation conv=Cache.get(threadId);
        if (conv == null) {
          conv=new Conversation(context,c,true);
          try {
            Cache.put(conv);
          }
 catch (          IllegalStateException e) {
            Log.e(TAG,"String_Node_Str");
          }
        }
 else {
          fillFromCursor(context,conv,c,true);
        }
      }
    }
  finally {
      c.close();
    }
    Cache.keepOnly(threadsOnDisk);
  }
}

Fixed version (ground truth):
private static void cacheAllThreads(Context context){
synchronized (Cache.getInstance()) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      LogTag.debug("String_Node_Str");
    }
    HashSet<Long> threadsOnDisk=new HashSet<Long>();
    Cursor c=context.getContentResolver().query(sAllThreadsUri,ALL_THREADS_PROJECTION,null,null,null);
    try {
      while (c.moveToNext()) {
        long threadId=c.getLong(ID);
        threadsOnDisk.add(threadId);
        Conversation conv=Cache.get(threadId);
        if (conv == null) {
          conv=new Conversation(context,c,true);
          try {
            Cache.put(conv);
          }
 catch (          IllegalStateException e) {
            LogTag.error("String_Node_Str");
          }
        }
 else {
          fillFromCursor(context,conv,c,true);
        }
      }
    }
  finally {
      c.close();
    }
    Cache.keepOnly(threadsOnDisk);
  }
}
Program: 44494
Project: 44494
Buggy source:
/** 
 * Guarantees that the conversation has been created in the database. This will make a blocking database call if it hasn't.
 * @return The thread ID of this conversation in the database
 */
public synchronized long ensureThreadId(){
  if (DEBUG) {
    Log.v("String_Node_Str","String_Node_Str" + mThreadId);
  }
  if (mThreadId <= 0) {
    mThreadId=getOrCreateThreadId(mContext,mRecipients);
  }
  if (DEBUG) {
    Log.v("String_Node_Str","String_Node_Str" + mThreadId);
  }
  return mThreadId;
}

Fixed version (ground truth):
/** 
 * Guarantees that the conversation has been created in the database. This will make a blocking database call if it hasn't.
 * @return The thread ID of this conversation in the database
 */
public synchronized long ensureThreadId(){
  if (DEBUG) {
    LogTag.debug("String_Node_Str" + mThreadId);
  }
  if (mThreadId <= 0) {
    mThreadId=getOrCreateThreadId(mContext,mRecipients);
  }
  if (DEBUG) {
    LogTag.debug("String_Node_Str" + mThreadId);
  }
  return mThreadId;
}
Program: 44495
Project: 44495
Buggy source:
public synchronized void clearThreadId(){
  Cache.remove(mThreadId);
  mThreadId=0;
}

Fixed version (ground truth):
public synchronized void clearThreadId(){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    LogTag.debug("String_Node_Str" + mThreadId + "String_Node_Str");
  }
  Cache.remove(mThreadId);
  mThreadId=0;
}
Program: 44496
Project: 44496
Buggy source:
private boolean loadFromThreadId(long threadId){
  Cursor c=mContext.getContentResolver().query(sAllThreadsUri,ALL_THREADS_PROJECTION,"String_Node_Str" + Long.toString(threadId),null,null);
  try {
    if (c.moveToFirst()) {
      fillFromCursor(mContext,this,c,true);
    }
 else {
      Log.e(TAG,"String_Node_Str" + threadId);
      return false;
    }
  }
  finally {
    c.close();
  }
  return true;
}

Fixed version (ground truth):
private boolean loadFromThreadId(long threadId){
  Cursor c=mContext.getContentResolver().query(sAllThreadsUri,ALL_THREADS_PROJECTION,"String_Node_Str" + Long.toString(threadId),null,null);
  try {
    if (c.moveToFirst()) {
      fillFromCursor(mContext,this,c,true);
    }
 else {
      LogTag.error("String_Node_Str" + threadId);
      return false;
    }
  }
  finally {
    c.close();
  }
  return true;
}
Program: 44497
Project: 44497
Buggy source:
private static long getOrCreateThreadId(Context context,ContactList list){
  HashSet<String> recipients=new HashSet<String>();
  Contact cacheContact=null;
  for (  Contact c : list) {
    cacheContact=Contact.get(c.getNumber(),true);
    if (cacheContact != null) {
      recipients.add(cacheContact.getNumber());
    }
 else {
      recipients.add(c.getNumber());
    }
  }
  return Threads.getOrCreateThreadId(context,recipients);
}

Fixed version (ground truth):
private static long getOrCreateThreadId(Context context,ContactList list){
  HashSet<String> recipients=new HashSet<String>();
  Contact cacheContact=null;
  for (  Contact c : list) {
    cacheContact=Contact.get(c.getNumber(),true);
    if (cacheContact != null) {
      recipients.add(cacheContact.getNumber());
    }
 else {
      recipients.add(c.getNumber());
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    LogTag.debug("String_Node_Str",recipients);
  }
  return Threads.getOrCreateThreadId(context,recipients);
}
Program: 44498
Project: 44498
Buggy source:
@Override public void process(){
  PduPersister persister=PduPersister.getPduPersister(mContext);
  try {
    ReadRecInd readRecInd=(ReadRecInd)persister.load(mReadReportURI);
    byte[] postingData=new PduComposer(mContext,readRecInd).make();
    sendPdu(postingData);
    Uri uri=persister.move(mReadReportURI,Sent.CONTENT_URI);
    mTransactionState.setState(TransactionState.SUCCESS);
    mTransactionState.setContentUri(uri);
  }
 catch (  IOException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  MmsException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  RuntimeException e) {
    if (LOCAL_LOGV) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
 finally {
    if (mTransactionState.getState() != TransactionState.SUCCESS) {
      mTransactionState.setState(TransactionState.FAILED);
      mTransactionState.setContentUri(mReadReportURI);
    }
    notifyObservers();
  }
}

Fixed version (ground truth):
@Override public void process(){
  PduPersister persister=PduPersister.getPduPersister(mContext);
  try {
    ReadRecInd readRecInd=(ReadRecInd)persister.load(mReadReportURI);
    String lineNumber=MessageUtils.getLocalNumber();
    readRecInd.setFrom(new EncodedStringValue(lineNumber));
    byte[] postingData=new PduComposer(mContext,readRecInd).make();
    sendPdu(postingData);
    Uri uri=persister.move(mReadReportURI,Sent.CONTENT_URI);
    mTransactionState.setState(TransactionState.SUCCESS);
    mTransactionState.setContentUri(uri);
  }
 catch (  IOException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  MmsException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  RuntimeException e) {
    if (LOCAL_LOGV) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
 finally {
    if (mTransactionState.getState() != TransactionState.SUCCESS) {
      mTransactionState.setState(TransactionState.FAILED);
      mTransactionState.setContentUri(mReadReportURI);
    }
    notifyObservers();
  }
}
Program: 44499
Project: 44499
Buggy source:
private void sendAcknowledgeInd(RetrieveConf rc) throws MmsException, IOException {
  byte[] tranId=rc.getTransactionId();
  if (tranId != null) {
    AcknowledgeInd acknowledgeInd=new AcknowledgeInd(PduHeaders.CURRENT_MMS_VERSION,tranId);
    if (MmsConfig.getNotifyWapMMSC()) {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make(),mContentLocation);
    }
 else {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make());
    }
  }
}

Fixed version (ground truth):
private void sendAcknowledgeInd(RetrieveConf rc) throws MmsException, IOException {
  byte[] tranId=rc.getTransactionId();
  if (tranId != null) {
    AcknowledgeInd acknowledgeInd=new AcknowledgeInd(PduHeaders.CURRENT_MMS_VERSION,tranId);
    String lineNumber=MessageUtils.getLocalNumber();
    acknowledgeInd.setFrom(new EncodedStringValue(lineNumber));
    if (MmsConfig.getNotifyWapMMSC()) {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make(),mContentLocation);
    }
 else {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make());
    }
  }
}
Program: 44501
Project: 44501
Buggy source:
private static String getLocalNumber(){
  if (null == sLocalNumber) {
    sLocalNumber=TelephonyManager.getDefault().getLine1Number();
  }
  return sLocalNumber;
}

Fixed version (ground truth):
public static String getLocalNumber(){
  if (null == sLocalNumber) {
    sLocalNumber=TelephonyManager.getDefault().getLine1Number();
  }
  return sLocalNumber;
}
Program: 44504
Project: 44504
Buggy source:
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;
  }
}

Fixed version (ground truth):
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;
  }
}
Program: 44505
Project: 44505
Buggy source:
@SmallTest public void testCompareSmsShortcode(){
  Log.i(LogTag.APP,"String_Node_Str");
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@SmallTest public void testCompareSmsShortcode(){
  Log.i(LogTag.APP,"String_Node_Str");
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
}
Program: 44507
Project: 44507
Buggy source:
public static boolean isAlias(String string){
  if (!Mms.isPhoneNumber(string) && isAlphaNumeric(string) && string.length() > 1 && string.length() <= MAX_ALIAS_LENGTH) {
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
public static boolean isAlias(String string){
  if (!MmsConfig.isAliasEnabled()) {
    return false;
  }
  if (TextUtils.isEmpty(string)) {
    return false;
  }
  if (Mms.isPhoneNumber(string)) {
    return false;
  }
  if (!isAlphaNumeric(string)) {
    return false;
  }
  int len=string.length();
  if (len < MmsConfig.getAliasMinChars() || len > MmsConfig.getAliasMaxChars()) {
    return false;
  }
  return true;
}
Program: 44509
Project: 44509
Buggy source:
@Override public void process(){
  PduPersister persister=PduPersister.getPduPersister(mContext);
  try {
    ReadRecInd readRecInd=(ReadRecInd)persister.load(mReadReportURI);
    byte[] postingData=new PduComposer(mContext,readRecInd).make();
    sendPdu(postingData);
    Uri uri=persister.move(mReadReportURI,Sent.CONTENT_URI);
    mTransactionState.setState(TransactionState.SUCCESS);
    mTransactionState.setContentUri(uri);
  }
 catch (  IOException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  MmsException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  RuntimeException e) {
    if (LOCAL_LOGV) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
 finally {
    if (mTransactionState.getState() != TransactionState.SUCCESS) {
      mTransactionState.setState(TransactionState.FAILED);
      mTransactionState.setContentUri(mReadReportURI);
    }
    notifyObservers();
  }
}

Fixed version (ground truth):
@Override public void process(){
  PduPersister persister=PduPersister.getPduPersister(mContext);
  try {
    ReadRecInd readRecInd=(ReadRecInd)persister.load(mReadReportURI);
    String lineNumber=MessageUtils.getLocalNumber();
    readRecInd.setFrom(new EncodedStringValue(lineNumber));
    byte[] postingData=new PduComposer(mContext,readRecInd).make();
    sendPdu(postingData);
    Uri uri=persister.move(mReadReportURI,Sent.CONTENT_URI);
    mTransactionState.setState(TransactionState.SUCCESS);
    mTransactionState.setContentUri(uri);
  }
 catch (  IOException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  MmsException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  RuntimeException e) {
    if (LOCAL_LOGV) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
 finally {
    if (mTransactionState.getState() != TransactionState.SUCCESS) {
      mTransactionState.setState(TransactionState.FAILED);
      mTransactionState.setContentUri(mReadReportURI);
    }
    notifyObservers();
  }
}
Program: 44510
Project: 44510
Buggy source:
private void sendAcknowledgeInd(RetrieveConf rc) throws MmsException, IOException {
  byte[] tranId=rc.getTransactionId();
  if (tranId != null) {
    AcknowledgeInd acknowledgeInd=new AcknowledgeInd(PduHeaders.CURRENT_MMS_VERSION,tranId);
    if (MmsConfig.getNotifyWapMMSC()) {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make(),mContentLocation);
    }
 else {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make());
    }
  }
}

Fixed version (ground truth):
private void sendAcknowledgeInd(RetrieveConf rc) throws MmsException, IOException {
  byte[] tranId=rc.getTransactionId();
  if (tranId != null) {
    AcknowledgeInd acknowledgeInd=new AcknowledgeInd(PduHeaders.CURRENT_MMS_VERSION,tranId);
    String lineNumber=MessageUtils.getLocalNumber();
    acknowledgeInd.setFrom(new EncodedStringValue(lineNumber));
    if (MmsConfig.getNotifyWapMMSC()) {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make(),mContentLocation);
    }
 else {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make());
    }
  }
}
Program: 44512
Project: 44512
Buggy source:
private static String getLocalNumber(){
  if (null == sLocalNumber) {
    sLocalNumber=TelephonyManager.getDefault().getLine1Number();
  }
  return sLocalNumber;
}

Fixed version (ground truth):
public static String getLocalNumber(){
  if (null == sLocalNumber) {
    sLocalNumber=TelephonyManager.getDefault().getLine1Number();
  }
  return sLocalNumber;
}
Program: 44513
Project: 44513
Buggy source:
@Override public void process(){
  PduPersister persister=PduPersister.getPduPersister(mContext);
  try {
    ReadRecInd readRecInd=(ReadRecInd)persister.load(mReadReportURI);
    byte[] postingData=new PduComposer(mContext,readRecInd).make();
    sendPdu(postingData);
    Uri uri=persister.move(mReadReportURI,Sent.CONTENT_URI);
    mTransactionState.setState(TransactionState.SUCCESS);
    mTransactionState.setContentUri(uri);
  }
 catch (  IOException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  MmsException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  RuntimeException e) {
    if (LOCAL_LOGV) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
 finally {
    if (mTransactionState.getState() != TransactionState.SUCCESS) {
      mTransactionState.setState(TransactionState.FAILED);
      mTransactionState.setContentUri(mReadReportURI);
    }
    notifyObservers();
  }
}

Fixed version (ground truth):
@Override public void process(){
  PduPersister persister=PduPersister.getPduPersister(mContext);
  try {
    ReadRecInd readRecInd=(ReadRecInd)persister.load(mReadReportURI);
    String lineNumber=MessageUtils.getLocalNumber();
    readRecInd.setFrom(new EncodedStringValue(lineNumber));
    byte[] postingData=new PduComposer(mContext,readRecInd).make();
    sendPdu(postingData);
    Uri uri=persister.move(mReadReportURI,Sent.CONTENT_URI);
    mTransactionState.setState(TransactionState.SUCCESS);
    mTransactionState.setContentUri(uri);
  }
 catch (  IOException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  MmsException e) {
    if (LOCAL_LOGV) {
      Log.v(TAG,"String_Node_Str",e);
    }
  }
catch (  RuntimeException e) {
    if (LOCAL_LOGV) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
 finally {
    if (mTransactionState.getState() != TransactionState.SUCCESS) {
      mTransactionState.setState(TransactionState.FAILED);
      mTransactionState.setContentUri(mReadReportURI);
    }
    notifyObservers();
  }
}
Program: 44514
Project: 44514
Buggy source:
private void sendAcknowledgeInd(RetrieveConf rc) throws MmsException, IOException {
  byte[] tranId=rc.getTransactionId();
  if (tranId != null) {
    AcknowledgeInd acknowledgeInd=new AcknowledgeInd(PduHeaders.CURRENT_MMS_VERSION,tranId);
    if (MmsConfig.getNotifyWapMMSC()) {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make(),mContentLocation);
    }
 else {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make());
    }
  }
}

Fixed version (ground truth):
private void sendAcknowledgeInd(RetrieveConf rc) throws MmsException, IOException {
  byte[] tranId=rc.getTransactionId();
  if (tranId != null) {
    AcknowledgeInd acknowledgeInd=new AcknowledgeInd(PduHeaders.CURRENT_MMS_VERSION,tranId);
    String lineNumber=MessageUtils.getLocalNumber();
    acknowledgeInd.setFrom(new EncodedStringValue(lineNumber));
    if (MmsConfig.getNotifyWapMMSC()) {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make(),mContentLocation);
    }
 else {
      sendPdu(new PduComposer(mContext,acknowledgeInd).make());
    }
  }
}
Program: 44516
Project: 44516
Buggy source:
private static String getLocalNumber(){
  if (null == sLocalNumber) {
    sLocalNumber=TelephonyManager.getDefault().getLine1Number();
  }
  return sLocalNumber;
}

Fixed version (ground truth):
public static String getLocalNumber(){
  if (null == sLocalNumber) {
    sLocalNumber=TelephonyManager.getDefault().getLine1Number();
  }
  return sLocalNumber;
}
Program: 44517
Project: 44517
Buggy source:
static void dumpCache(){
  if (DEBUG) {
synchronized (sInstance) {
      Log.v(TAG,"String_Node_Str");
      for (      Conversation c : sInstance.mCache) {
        Log.v(TAG,"String_Node_Str" + c + "String_Node_Str"+ c.getThreadId()+ "String_Node_Str"+ c.hashCode());
      }
    }
  }
}

Fixed version (ground truth):
static void dumpCache(){
  if (DEBUG) {
synchronized (sInstance) {
      LogTag.debug("String_Node_Str");
      for (      Conversation c : sInstance.mCache) {
        LogTag.debug("String_Node_Str" + c + "String_Node_Str"+ c.getThreadId()+ "String_Node_Str"+ c.hashCode());
      }
    }
  }
}
Program: 44518
Project: 44518
Buggy source:
/** 
 * Put the specified conversation in the cache.  The caller should not place an already-existing conversation in the cache, but rather update it in place.
 */
static void put(Conversation c){
synchronized (sInstance) {
    if (DEBUG) {
      Log.v(TAG,"String_Node_Str" + c + "String_Node_Str"+ c.getThreadId()+ "String_Node_Str"+ c.hashCode());
      dumpCache();
    }
    if (sInstance.mCache.contains(c)) {
      throw new IllegalStateException("String_Node_Str" + c + "String_Node_Str"+ c.mThreadId);
    }
    sInstance.mCache.add(c);
  }
}

Fixed version (ground truth):
/** 
 * Put the specified conversation in the cache.  The caller should not place an already-existing conversation in the cache, but rather update it in place.
 */
static void put(Conversation c){
synchronized (sInstance) {
    if (DEBUG) {
      LogTag.debug("String_Node_Str" + c + "String_Node_Str"+ c.getThreadId()+ "String_Node_Str"+ c.hashCode());
      dumpCache();
    }
    if (sInstance.mCache.contains(c)) {
      throw new IllegalStateException("String_Node_Str" + c + "String_Node_Str"+ c.mThreadId);
    }
    sInstance.mCache.add(c);
  }
}
Program: 44519
Project: 44519
Buggy source:
static void remove(long threadId){
  if (DEBUG) {
    Log.v(TAG,"String_Node_Str" + threadId);
    dumpCache();
  }
  for (  Conversation c : sInstance.mCache) {
    if (c.getThreadId() == threadId) {
      sInstance.mCache.remove(c);
      return;
    }
  }
}

Fixed version (ground truth):
static void remove(long threadId){
  if (DEBUG) {
    LogTag.debug("String_Node_Str" + threadId);
    dumpCache();
  }
  for (  Conversation c : sInstance.mCache) {
    if (c.getThreadId() == threadId) {
      sInstance.mCache.remove(c);
      return;
    }
  }
}
Program: 44520
Project: 44520
Buggy source:
/** 
 * Return the conversation with the specified recipient list, or null if it's not in cache.
 */
static Conversation get(ContactList list){
synchronized (sInstance) {
    if (DEBUG) {
      Log.v(TAG,"String_Node_Str" + list);
      dumpCache();
    }
    for (    Conversation c : sInstance.mCache) {
      if (c.getRecipients().equals(list)) {
        return c;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return the conversation with the specified recipient list, or null if it's not in cache.
 */
static Conversation get(ContactList list){
synchronized (sInstance) {
    if (DEBUG) {
      LogTag.debug("String_Node_Str" + list);
      dumpCache();
    }
    for (    Conversation c : sInstance.mCache) {
      if (c.getRecipients().equals(list)) {
        return c;
      }
    }
  }
  return null;
}
Program: 44521
Project: 44521
Buggy source:
private static void cacheAllThreads(Context context){
synchronized (Cache.getInstance()) {
    if (DEBUG) {
      Log.v(TAG,"String_Node_Str");
    }
    HashSet<Long> threadsOnDisk=new HashSet<Long>();
    Cursor c=context.getContentResolver().query(sAllThreadsUri,ALL_THREADS_PROJECTION,null,null,null);
    try {
      while (c.moveToNext()) {
        long threadId=c.getLong(ID);
        threadsOnDisk.add(threadId);
        Conversation conv=Cache.get(threadId);
        if (conv == null) {
          conv=new Conversation(context,c,true);
          try {
            Cache.put(conv);
          }
 catch (          IllegalStateException e) {
            Log.e(TAG,"String_Node_Str");
          }
        }
 else {
          fillFromCursor(context,conv,c,true);
        }
      }
    }
  finally {
      c.close();
    }
    Cache.keepOnly(threadsOnDisk);
  }
}

Fixed version (ground truth):
private static void cacheAllThreads(Context context){
synchronized (Cache.getInstance()) {
    if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
      LogTag.debug("String_Node_Str");
    }
    HashSet<Long> threadsOnDisk=new HashSet<Long>();
    Cursor c=context.getContentResolver().query(sAllThreadsUri,ALL_THREADS_PROJECTION,null,null,null);
    try {
      while (c.moveToNext()) {
        long threadId=c.getLong(ID);
        threadsOnDisk.add(threadId);
        Conversation conv=Cache.get(threadId);
        if (conv == null) {
          conv=new Conversation(context,c,true);
          try {
            Cache.put(conv);
          }
 catch (          IllegalStateException e) {
            LogTag.error("String_Node_Str");
          }
        }
 else {
          fillFromCursor(context,conv,c,true);
        }
      }
    }
  finally {
      c.close();
    }
    Cache.keepOnly(threadsOnDisk);
  }
}
Program: 44522
Project: 44522
Buggy source:
/** 
 * Guarantees that the conversation has been created in the database. This will make a blocking database call if it hasn't.
 * @return The thread ID of this conversation in the database
 */
public synchronized long ensureThreadId(){
  if (DEBUG) {
    Log.v("String_Node_Str","String_Node_Str" + mThreadId);
  }
  if (mThreadId <= 0) {
    mThreadId=getOrCreateThreadId(mContext,mRecipients);
  }
  if (DEBUG) {
    Log.v("String_Node_Str","String_Node_Str" + mThreadId);
  }
  return mThreadId;
}

Fixed version (ground truth):
/** 
 * Guarantees that the conversation has been created in the database. This will make a blocking database call if it hasn't.
 * @return The thread ID of this conversation in the database
 */
public synchronized long ensureThreadId(){
  if (DEBUG) {
    LogTag.debug("String_Node_Str" + mThreadId);
  }
  if (mThreadId <= 0) {
    mThreadId=getOrCreateThreadId(mContext,mRecipients);
  }
  if (DEBUG) {
    LogTag.debug("String_Node_Str" + mThreadId);
  }
  return mThreadId;
}
Program: 44523
Project: 44523
Buggy source:
public synchronized void clearThreadId(){
  Cache.remove(mThreadId);
  mThreadId=0;
}

Fixed version (ground truth):
public synchronized void clearThreadId(){
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    LogTag.debug("String_Node_Str" + mThreadId + "String_Node_Str");
  }
  Cache.remove(mThreadId);
  mThreadId=0;
}
Program: 44524
Project: 44524
Buggy source:
private boolean loadFromThreadId(long threadId){
  Cursor c=mContext.getContentResolver().query(sAllThreadsUri,ALL_THREADS_PROJECTION,"String_Node_Str" + Long.toString(threadId),null,null);
  try {
    if (c.moveToFirst()) {
      fillFromCursor(mContext,this,c,true);
    }
 else {
      Log.e(TAG,"String_Node_Str" + threadId);
      return false;
    }
  }
  finally {
    c.close();
  }
  return true;
}

Fixed version (ground truth):
private boolean loadFromThreadId(long threadId){
  Cursor c=mContext.getContentResolver().query(sAllThreadsUri,ALL_THREADS_PROJECTION,"String_Node_Str" + Long.toString(threadId),null,null);
  try {
    if (c.moveToFirst()) {
      fillFromCursor(mContext,this,c,true);
    }
 else {
      LogTag.error("String_Node_Str" + threadId);
      return false;
    }
  }
  finally {
    c.close();
  }
  return true;
}
Program: 44525
Project: 44525
Buggy source:
private static long getOrCreateThreadId(Context context,ContactList list){
  HashSet<String> recipients=new HashSet<String>();
  Contact cacheContact=null;
  for (  Contact c : list) {
    cacheContact=Contact.get(c.getNumber(),true);
    if (cacheContact != null) {
      recipients.add(cacheContact.getNumber());
    }
 else {
      recipients.add(c.getNumber());
    }
  }
  return Threads.getOrCreateThreadId(context,recipients);
}

Fixed version (ground truth):
private static long getOrCreateThreadId(Context context,ContactList list){
  HashSet<String> recipients=new HashSet<String>();
  Contact cacheContact=null;
  for (  Contact c : list) {
    cacheContact=Contact.get(c.getNumber(),true);
    if (cacheContact != null) {
      recipients.add(cacheContact.getNumber());
    }
 else {
      recipients.add(c.getNumber());
    }
  }
  if (Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    LogTag.debug("String_Node_Str",recipients);
  }
  return Threads.getOrCreateThreadId(context,recipients);
}
Program: 44526
Project: 44526
Buggy source:
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;
  }
}

Fixed version (ground truth):
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;
  }
}
Program: 44527
Project: 44527
Buggy source:
@SmallTest public void testCompareSmsShortcode(){
  Log.i(LogTag.APP,"String_Node_Str");
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@SmallTest public void testCompareSmsShortcode(){
  Log.i(LogTag.APP,"String_Node_Str");
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
}
Program: 44528
Project: 44528
Buggy source:
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;
  }
}

Fixed version (ground truth):
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;
  }
}
Program: 44529
Project: 44529
Buggy source:
@SmallTest public void testCompareSmsShortcode(){
  Log.i(LogTag.APP,"String_Node_Str");
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
  assertFalse(AddressUtils.phoneNumbersEqual("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@SmallTest public void testCompareSmsShortcode(){
  Log.i(LogTag.APP,"String_Node_Str");
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
  assertFalse(PhoneNumberUtils.compare("String_Node_Str","String_Node_Str"));
}
Program: 44530
Project: 44530
Buggy source:
private boolean handleForwardedMessage(){
  Intent intent=getIntent();
  if (intent.getBooleanExtra("String_Node_Str",false) == false) {
    return false;
  }
  Uri uri=intent.getParcelableExtra("String_Node_Str");
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + uri);
  }
  if (uri != null) {
    mWorkingMessage=WorkingMessage.load(this,uri);
    mWorkingMessage.setSubject(intent.getStringExtra("String_Node_Str"),false);
  }
 else {
    mWorkingMessage.setText(intent.getStringExtra("String_Node_Str"));
  }
  return true;
}

Fixed version (ground truth):
private boolean handleForwardedMessage(){
  Intent intent=getIntent();
  if (intent.getBooleanExtra("String_Node_Str",false) == false) {
    return false;
  }
  Uri uri=intent.getParcelableExtra("String_Node_Str");
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + uri);
  }
  if (uri != null) {
    mWorkingMessage=WorkingMessage.load(this,uri);
    mWorkingMessage.setSubject(intent.getStringExtra("String_Node_Str"),false);
  }
 else {
    mWorkingMessage.setText(intent.getStringExtra("String_Node_Str"));
  }
  mMsgListAdapter.changeCursor(null);
  return true;
}
Program: 44531
Project: 44531
Buggy source:
private void bindToContactHeaderWidget(ContactList list){
switch (list.size()) {
case 0:
    mContactHeader.setDisplayName(mRecipientsEditor.getText().toString(),null);
  break;
case 1:
mContactHeader.bindFromPhoneNumber(list.get(0).getNumber());
break;
default :
String multipleRecipientsString=getString(R.string.multiple_recipients,list.size());
mContactHeader.setDisplayName(multipleRecipientsString,null);
break;
}
}

Fixed version (ground truth):
private void bindToContactHeaderWidget(ContactList list){
switch (list.size()) {
case 0:
    String recipient="String_Node_Str";
  if (mRecipientsEditor != null) {
    recipient=mRecipientsEditor.getText().toString();
  }
mContactHeader.setDisplayName(recipient,null);
break;
case 1:
mContactHeader.bindFromPhoneNumber(list.get(0).getNumber());
break;
default :
String multipleRecipientsString=getString(R.string.multiple_recipients,list.size());
mContactHeader.setDisplayName(multipleRecipientsString,null);
break;
}
}
Program: 44532
Project: 44532
Buggy source:
private boolean handleForwardedMessage(){
  Intent intent=getIntent();
  if (intent.getBooleanExtra("String_Node_Str",false) == false) {
    return false;
  }
  Uri uri=intent.getParcelableExtra("String_Node_Str");
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + uri);
  }
  if (uri != null) {
    mWorkingMessage=WorkingMessage.load(this,uri);
    mWorkingMessage.setSubject(intent.getStringExtra("String_Node_Str"),false);
  }
 else {
    mWorkingMessage.setText(intent.getStringExtra("String_Node_Str"));
  }
  return true;
}

Fixed version (ground truth):
private boolean handleForwardedMessage(){
  Intent intent=getIntent();
  if (intent.getBooleanExtra("String_Node_Str",false) == false) {
    return false;
  }
  Uri uri=intent.getParcelableExtra("String_Node_Str");
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + uri);
  }
  if (uri != null) {
    mWorkingMessage=WorkingMessage.load(this,uri);
    mWorkingMessage.setSubject(intent.getStringExtra("String_Node_Str"),false);
  }
 else {
    mWorkingMessage.setText(intent.getStringExtra("String_Node_Str"));
  }
  mMsgListAdapter.changeCursor(null);
  return true;
}
Program: 44533
Project: 44533
Buggy source:
private void bindToContactHeaderWidget(ContactList list){
switch (list.size()) {
case 0:
    mContactHeader.setDisplayName(mRecipientsEditor.getText().toString(),null);
  break;
case 1:
mContactHeader.bindFromPhoneNumber(list.get(0).getNumber());
break;
default :
String multipleRecipientsString=getString(R.string.multiple_recipients,list.size());
mContactHeader.setDisplayName(multipleRecipientsString,null);
break;
}
}

Fixed version (ground truth):
private void bindToContactHeaderWidget(ContactList list){
switch (list.size()) {
case 0:
    String recipient="String_Node_Str";
  if (mRecipientsEditor != null) {
    recipient=mRecipientsEditor.getText().toString();
  }
mContactHeader.setDisplayName(recipient,null);
break;
case 1:
mContactHeader.bindFromPhoneNumber(list.get(0).getNumber());
break;
default :
String multipleRecipientsString=getString(R.string.multiple_recipients,list.size());
mContactHeader.setDisplayName(multipleRecipientsString,null);
break;
}
}
Program: 44534
Project: 44534
Buggy source:
private boolean handleForwardedMessage(){
  Intent intent=getIntent();
  if (intent.getBooleanExtra("String_Node_Str",false) == false) {
    return false;
  }
  Uri uri=intent.getParcelableExtra("String_Node_Str");
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + uri);
  }
  if (uri != null) {
    mWorkingMessage=WorkingMessage.load(this,uri);
    mWorkingMessage.setSubject(intent.getStringExtra("String_Node_Str"),false);
  }
 else {
    mWorkingMessage.setText(intent.getStringExtra("String_Node_Str"));
  }
  return true;
}

Fixed version (ground truth):
private boolean handleForwardedMessage(){
  Intent intent=getIntent();
  if (intent.getBooleanExtra("String_Node_Str",false) == false) {
    return false;
  }
  Uri uri=intent.getParcelableExtra("String_Node_Str");
  if (Log.isLoggable(LogTag.APP,Log.DEBUG)) {
    log("String_Node_Str" + uri);
  }
  if (uri != null) {
    mWorkingMessage=WorkingMessage.load(this,uri);
    mWorkingMessage.setSubject(intent.getStringExtra("String_Node_Str"),false);
  }
 else {
    mWorkingMessage.setText(intent.getStringExtra("String_Node_Str"));
  }
  mMsgListAdapter.changeCursor(null);
  return true;
}
Program: 44535
Project: 44535
Buggy source:
private void bindToContactHeaderWidget(ContactList list){
switch (list.size()) {
case 0:
    mContactHeader.setDisplayName(mRecipientsEditor.getText().toString(),null);
  break;
case 1:
mContactHeader.bindFromPhoneNumber(list.get(0).getNumber());
break;
default :
String multipleRecipientsString=getString(R.string.multiple_recipients,list.size());
mContactHeader.setDisplayName(multipleRecipientsString,null);
break;
}
}

Fixed version (ground truth):
private void bindToContactHeaderWidget(ContactList list){
switch (list.size()) {
case 0:
    String recipient="String_Node_Str";
  if (mRecipientsEditor != null) {
    recipient=mRecipientsEditor.getText().toString();
  }
mContactHeader.setDisplayName(recipient,null);
break;
case 1:
mContactHeader.bindFromPhoneNumber(list.get(0).getNumber());
break;
default :
String multipleRecipientsString=getString(R.string.multiple_recipients,list.size());
mContactHeader.setDisplayName(multipleRecipientsString,null);
break;
}
}
Program: 44536
Project: 44536
Buggy source:
public void handleEvent(Event evt){
  String evtType=evt.getType();
  if (LOCAL_LOGV) {
    Log.v(TAG,"String_Node_Str" + evtType + "String_Node_Str"+ this);
  }
  MediaAction action=MediaAction.NO_ACTIVE_ACTION;
  if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_START_EVENT)) {
    action=MediaAction.START;
    pauseMusicPlayer();
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_END_EVENT)) {
    action=MediaAction.STOP;
    resumeMusicPlayer();
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_PAUSE_EVENT)) {
    action=MediaAction.PAUSE;
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_SEEK_EVENT)) {
    action=MediaAction.SEEK;
    mSeekTo=evt.getSeekTo();
  }
  appendAction(action);
  notifyModelChanged(false);
}

Fixed version (ground truth):
public void handleEvent(Event evt){
  String evtType=evt.getType();
  if (LOCAL_LOGV) {
    Log.v(TAG,"String_Node_Str" + evtType + "String_Node_Str"+ this);
  }
  MediaAction action=MediaAction.NO_ACTIVE_ACTION;
  if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_START_EVENT)) {
    action=MediaAction.START;
    pauseMusicPlayer();
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_END_EVENT)) {
    action=MediaAction.STOP;
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_PAUSE_EVENT)) {
    action=MediaAction.PAUSE;
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_SEEK_EVENT)) {
    action=MediaAction.SEEK;
    mSeekTo=evt.getSeekTo();
  }
  appendAction(action);
  notifyModelChanged(false);
}
Program: 44537
Project: 44537
Buggy source:
public void handleEvent(Event evt){
  String evtType=evt.getType();
  if (LOCAL_LOGV || Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + evt.getType() + "String_Node_Str"+ this);
  }
  MediaAction action=MediaAction.NO_ACTIVE_ACTION;
  if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_START_EVENT)) {
    action=MediaAction.START;
    pauseMusicPlayer();
    mVisible=true;
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_END_EVENT)) {
    action=MediaAction.STOP;
    if (mFill != ElementTime.FILL_FREEZE) {
      mVisible=false;
    }
    resumeMusicPlayer();
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_PAUSE_EVENT)) {
    action=MediaAction.PAUSE;
    mVisible=true;
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_SEEK_EVENT)) {
    action=MediaAction.SEEK;
    mSeekTo=evt.getSeekTo();
    mVisible=true;
  }
  appendAction(action);
  notifyModelChanged(false);
}

Fixed version (ground truth):
public void handleEvent(Event evt){
  String evtType=evt.getType();
  if (LOCAL_LOGV || Log.isLoggable(LogTag.APP,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + evt.getType() + "String_Node_Str"+ this);
  }
  MediaAction action=MediaAction.NO_ACTIVE_ACTION;
  if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_START_EVENT)) {
    action=MediaAction.START;
    pauseMusicPlayer();
    mVisible=true;
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_END_EVENT)) {
    action=MediaAction.STOP;
    if (mFill != ElementTime.FILL_FREEZE) {
      mVisible=false;
    }
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_PAUSE_EVENT)) {
    action=MediaAction.PAUSE;
    mVisible=true;
  }
 else   if (evtType.equals(SmilMediaElementImpl.SMIL_MEDIA_SEEK_EVENT)) {
    action=MediaAction.SEEK;
    mSeekTo=evt.getSeekTo();
    mVisible=true;
  }
  appendAction(action);
  notifyModelChanged(false);
}
Program: 44538
Project: 44538
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: 44539
Project: 44539
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: 44540
Project: 44540
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: 44541
Project: 44541
Buggy source:
@Override protected void onPause(){
  super.onPause();
  Contact.stopPresenceObserver();
  removeRecipientsListeners();
}

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

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  addRecipientsListeners();
}