nus-yam/ex-repair huggingface dataset:
Program: 23469
Project: 23469
Buggy source:
void performRemoveIcon(IBinder key){
synchronized (this) {
    if (DBG) {
      Log.d(TAG,"String_Node_Str" + key);
    }
    StatusBarIcon icon=mIconMap.remove(key);
    mIconList.remove(icon);
    if (icon != null) {
      ViewGroup parent=(ViewGroup)icon.view.getParent();
      parent.removeView(icon.view);
      int slotIndex=getRightIconIndex(icon.mData.slot);
      if (slotIndex >= 0) {
        mRightIcons[slotIndex]=null;
      }
    }
    StatusBarNotification notification=getNotification(key);
    if (notification != null) {
      removeNotificationView(notification);
synchronized (mNotificationData) {
        mNotificationData.remove(notification);
      }
      setAreThereNotifications();
    }
  }
}

Fixed version (ground truth):
void performRemoveIcon(IBinder key){
synchronized (this) {
    if (SPEW) {
      Log.d(TAG,"String_Node_Str" + key);
    }
    StatusBarIcon icon=mIconMap.remove(key);
    mIconList.remove(icon);
    if (icon != null) {
      ViewGroup parent=(ViewGroup)icon.view.getParent();
      parent.removeView(icon.view);
      int slotIndex=getRightIconIndex(icon.mData.slot);
      if (slotIndex >= 0) {
        mRightIcons[slotIndex]=null;
      }
    }
    StatusBarNotification notification=getNotification(key);
    if (notification != null) {
      removeNotificationView(notification);
synchronized (mNotificationData) {
        mNotificationData.remove(notification);
      }
      setAreThereNotifications();
    }
  }
}
Program: 23470
Project: 23470
Buggy source:
void performDisableActions(int net){
  int old=mDisabled;
  int diff=net ^ old;
  mDisabled=net;
  if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) {
    if ((net & StatusBarManager.DISABLE_EXPAND) != 0) {
      performCollapse();
    }
  }
  if ((diff & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) {
    if ((net & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) {
      Log.d(TAG,"String_Node_Str");
      if (mTicking) {
        mNotificationIcons.setVisibility(View.INVISIBLE);
        mTicker.halt();
      }
 else {
        setNotificationIconVisibility(false,com.android.internal.R.anim.fade_out);
      }
    }
 else {
      Log.d(TAG,"String_Node_Str");
      if (!mExpandedVisible) {
        setNotificationIconVisibility(true,com.android.internal.R.anim.fade_in);
      }
    }
  }
}

Fixed version (ground truth):
void performDisableActions(int net){
  int old=mDisabled;
  int diff=net ^ old;
  mDisabled=net;
  if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) {
    if ((net & StatusBarManager.DISABLE_EXPAND) != 0) {
      animateCollapse();
    }
  }
  if ((diff & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) {
    if ((net & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) {
      Log.d(TAG,"String_Node_Str");
      if (mTicking) {
        mNotificationIcons.setVisibility(View.INVISIBLE);
        mTicker.halt();
      }
 else {
        setNotificationIconVisibility(false,com.android.internal.R.anim.fade_out);
      }
    }
 else {
      Log.d(TAG,"String_Node_Str");
      if (!mExpandedVisible) {
        setNotificationIconVisibility(true,com.android.internal.R.anim.fade_in);
      }
    }
  }
}
Program: 23472
Project: 23472
Buggy source:
void performSetIconVisibility(IBinder key,boolean visible){
synchronized (mIconMap) {
    if (DBG) {
      Log.d(TAG,"String_Node_Str" + key + "String_Node_Str"+ visible);
    }
    StatusBarIcon icon=mIconMap.get(key);
    icon.view.setVisibility(visible ? View.VISIBLE : View.GONE);
  }
}

Fixed version (ground truth):
void performSetIconVisibility(IBinder key,boolean visible){
synchronized (mIconMap) {
    if (SPEW) {
      Log.d(TAG,"String_Node_Str" + key + "String_Node_Str"+ visible);
    }
    StatusBarIcon icon=mIconMap.get(key);
    icon.view.setVisibility(visible ? View.VISIBLE : View.GONE);
  }
}
Program: 23473
Project: 23473
Buggy source:
void performRemoveIcon(IBinder key){
synchronized (this) {
    if (DBG) {
      Log.d(TAG,"String_Node_Str" + key);
    }
    StatusBarIcon icon=mIconMap.remove(key);
    mIconList.remove(icon);
    if (icon != null) {
      ViewGroup parent=(ViewGroup)icon.view.getParent();
      parent.removeView(icon.view);
      int slotIndex=getRightIconIndex(icon.mData.slot);
      if (slotIndex >= 0) {
        mRightIcons[slotIndex]=null;
      }
    }
    StatusBarNotification notification=getNotification(key);
    if (notification != null) {
      removeNotificationView(notification);
synchronized (mNotificationData) {
        mNotificationData.remove(notification);
      }
      setAreThereNotifications();
    }
  }
}

Fixed version (ground truth):
void performRemoveIcon(IBinder key){
synchronized (this) {
    if (SPEW) {
      Log.d(TAG,"String_Node_Str" + key);
    }
    StatusBarIcon icon=mIconMap.remove(key);
    mIconList.remove(icon);
    if (icon != null) {
      ViewGroup parent=(ViewGroup)icon.view.getParent();
      parent.removeView(icon.view);
      int slotIndex=getRightIconIndex(icon.mData.slot);
      if (slotIndex >= 0) {
        mRightIcons[slotIndex]=null;
      }
    }
    StatusBarNotification notification=getNotification(key);
    if (notification != null) {
      removeNotificationView(notification);
synchronized (mNotificationData) {
        mNotificationData.remove(notification);
      }
      setAreThereNotifications();
    }
  }
}
Program: 23474
Project: 23474
Buggy source:
/** 
 * Some Japanese mobile phones use this field for phonetic name, since vCard 2.1 does not have "SORT-STRING" type. Also, in some cases, the field has some ';'s in it. Assume the ';' means the same meaning in N property
 */
@SuppressWarnings("String_Node_Str") private void handlePhoneticNameFromSound(List<String> elems){
  int size;
  if (elems == null || (size=elems.size()) < 1) {
    return;
  }
  if (size > 3) {
    size=3;
  }
switch (size) {
case 3:
    mPhoneticMiddleName=elems.get(2);
case 2:
  mPhoneticGivenName=elems.get(1);
default :
mPhoneticFamilyName=elems.get(0);
}
}

Fixed version (ground truth):
/** 
 * Some Japanese mobile phones use this field for phonetic name, since vCard 2.1 does not have "SORT-STRING" type. Also, in some cases, the field has some ';'s in it. Assume the ';' means the same meaning in N property
 */
@SuppressWarnings("String_Node_Str") private void handlePhoneticNameFromSound(List<String> elems){
  if (!(TextUtils.isEmpty(mPhoneticFamilyName) && TextUtils.isEmpty(mPhoneticMiddleName) && TextUtils.isEmpty(mPhoneticGivenName))) {
    return;
  }
  int size;
  if (elems == null || (size=elems.size()) < 1) {
    return;
  }
  if (size > 3) {
    size=3;
  }
  if (elems.get(0).length() > 0) {
    boolean onlyFirstElemIsNonEmpty=true;
    for (int i=1; i < size; i++) {
      if (elems.get(i).length() > 0) {
        onlyFirstElemIsNonEmpty=false;
        break;
      }
    }
    if (onlyFirstElemIsNonEmpty) {
      final String[] namesArray=elems.get(0).split("String_Node_Str");
      final int nameArrayLength=namesArray.length;
      if (nameArrayLength == 3) {
        mPhoneticFamilyName=namesArray[0];
        mPhoneticMiddleName=namesArray[1];
        mPhoneticGivenName=namesArray[2];
      }
 else       if (nameArrayLength == 2) {
        mPhoneticFamilyName=namesArray[0];
        mPhoneticGivenName=namesArray[1];
      }
 else {
        mPhoneticFullName=elems.get(0);
      }
      return;
    }
  }
switch (size) {
case 3:
    mPhoneticMiddleName=elems.get(2);
case 2:
  mPhoneticGivenName=elems.get(1);
default :
mPhoneticFamilyName=elems.get(0);
}
}
Program: 23475
Project: 23475
Buggy source:
/** 
 * Construct the display name. The constructed data must not be null.
 */
private void constructDisplayName(){
  if (!TextUtils.isEmpty(mFullName)) {
    mDisplayName=mFullName;
  }
 else   if (!(TextUtils.isEmpty(mFamilyName) && TextUtils.isEmpty(mGivenName))) {
    StringBuilder builder=new StringBuilder();
    List<String> nameList;
switch (VCardConfig.getNameOrderType(mVCardType)) {
case VCardConfig.NAME_ORDER_JAPANESE:
      if (VCardUtils.containsOnlyPrintableAscii(mFamilyName) && VCardUtils.containsOnlyPrintableAscii(mGivenName)) {
        nameList=Arrays.asList(mPrefix,mGivenName,mMiddleName,mFamilyName,mSuffix);
      }
 else {
        nameList=Arrays.asList(mPrefix,mFamilyName,mMiddleName,mGivenName,mSuffix);
      }
    break;
case VCardConfig.NAME_ORDER_EUROPE:
  nameList=Arrays.asList(mPrefix,mMiddleName,mGivenName,mFamilyName,mSuffix);
break;
default :
nameList=Arrays.asList(mPrefix,mGivenName,mMiddleName,mFamilyName,mSuffix);
break;
}
boolean first=true;
for (String namePart : nameList) {
if (!TextUtils.isEmpty(namePart)) {
if (first) {
first=false;
}
 else {
builder.append(' ');
}
builder.append(namePart);
}
}
mDisplayName=builder.toString();
}
 else if (!(TextUtils.isEmpty(mPhoneticFamilyName) && TextUtils.isEmpty(mPhoneticGivenName))) {
mDisplayName=VCardUtils.constructNameFromElements(mVCardType,mPhoneticFamilyName,mPhoneticMiddleName,mPhoneticGivenName);
}
 else if (mEmailList != null && mEmailList.size() > 0) {
mDisplayName=mEmailList.get(0).data;
}
 else if (mPhoneList != null && mPhoneList.size() > 0) {
mDisplayName=mPhoneList.get(0).data;
}
 else if (mPostalList != null && mPostalList.size() > 0) {
mDisplayName=mPostalList.get(0).getFormattedAddress(mVCardType);
}
if (mDisplayName == null) {
mDisplayName="String_Node_Str";
}
}

Fixed version (ground truth):
/** 
 * Construct the display name. The constructed data must not be null.
 */
private void constructDisplayName(){
  if (!TextUtils.isEmpty(mFullName)) {
    mDisplayName=mFullName;
  }
 else   if (!(TextUtils.isEmpty(mFamilyName) && TextUtils.isEmpty(mGivenName))) {
    mDisplayName=VCardUtils.constructNameFromElements(mVCardType,mFamilyName,mMiddleName,mGivenName,mPrefix,mSuffix);
  }
 else   if (!(TextUtils.isEmpty(mPhoneticFamilyName) && TextUtils.isEmpty(mPhoneticGivenName))) {
    mDisplayName=VCardUtils.constructNameFromElements(mVCardType,mPhoneticFamilyName,mPhoneticMiddleName,mPhoneticGivenName);
  }
 else   if (mEmailList != null && mEmailList.size() > 0) {
    mDisplayName=mEmailList.get(0).data;
  }
 else   if (mPhoneList != null && mPhoneList.size() > 0) {
    mDisplayName=mPhoneList.get(0).data;
  }
 else   if (mPostalList != null && mPostalList.size() > 0) {
    mDisplayName=mPostalList.get(0).getFormattedAddress(mVCardType);
  }
  if (mDisplayName == null) {
    mDisplayName="String_Node_Str";
  }
}
Program: 23476
Project: 23476
Buggy source:
/** 
 * Returns true when the property line should contain charset parameter information. This method may return true even when vCard version is 3.0. Strictly, adding charset information is invalid in VCard 3.0. However we'll add the info only when charset we use is not UTF-8 in vCard 3.0 format, since parser side may be able to use the charset via this field, though we may encounter another problem by adding it. e.g. Japanese mobile phones use Shift_Jis while RFC 2426 recommends UTF-8. By adding this field, parsers may be able to know this text is NOT UTF-8 but Shift_Jis.
 */
private boolean shouldAppendCharsetParameter(final String propertyValue){
  return (!VCardUtils.containsOnlyPrintableAscii(propertyValue) && (!mIsV30 || !mUsesUtf8));
}

Fixed version (ground truth):
/** 
 * Returns true when the property line should contain charset parameter information. This method may return true even when vCard version is 3.0. Strictly, adding charset information is invalid in VCard 3.0. However we'll add the info only when charset we use is not UTF-8 in vCard 3.0 format, since parser side may be able to use the charset via this field, though we may encounter another problem by adding it. e.g. Japanese mobile phones use Shift_Jis while RFC 2426 recommends UTF-8. By adding this field, parsers may be able to know this text is NOT UTF-8 but Shift_Jis.
 */
private boolean shouldAppendCharsetParameter(final String propertyValue){
  return (!(mIsV30 && mUsesUtf8) && !VCardUtils.containsOnlyPrintableAscii(propertyValue));
}
Program: 23477
Project: 23477
Buggy source:
private boolean containsNonEmptyName(ContentValues contentValues){
  final String familyName=contentValues.getAsString(StructuredName.FAMILY_NAME);
  final String middleName=contentValues.getAsString(StructuredName.MIDDLE_NAME);
  final String givenName=contentValues.getAsString(StructuredName.GIVEN_NAME);
  final String prefix=contentValues.getAsString(StructuredName.PREFIX);
  final String suffix=contentValues.getAsString(StructuredName.SUFFIX);
  final String displayName=contentValues.getAsString(StructuredName.DISPLAY_NAME);
  return !(TextUtils.isEmpty(familyName) && TextUtils.isEmpty(middleName) && TextUtils.isEmpty(givenName)&& TextUtils.isEmpty(prefix)&& TextUtils.isEmpty(suffix)&& TextUtils.isEmpty(displayName));
}

Fixed version (ground truth):
private boolean containsNonEmptyName(ContentValues contentValues){
  final String familyName=contentValues.getAsString(StructuredName.FAMILY_NAME);
  final String middleName=contentValues.getAsString(StructuredName.MIDDLE_NAME);
  final String givenName=contentValues.getAsString(StructuredName.GIVEN_NAME);
  final String prefix=contentValues.getAsString(StructuredName.PREFIX);
  final String suffix=contentValues.getAsString(StructuredName.SUFFIX);
  final String phoneticFamilyName=contentValues.getAsString(StructuredName.PHONETIC_FAMILY_NAME);
  final String phoneticMiddleName=contentValues.getAsString(StructuredName.PHONETIC_MIDDLE_NAME);
  final String phoneticGivenName=contentValues.getAsString(StructuredName.PHONETIC_GIVEN_NAME);
  final String displayName=contentValues.getAsString(StructuredName.DISPLAY_NAME);
  return !(TextUtils.isEmpty(familyName) && TextUtils.isEmpty(middleName) && TextUtils.isEmpty(givenName)&& TextUtils.isEmpty(prefix)&& TextUtils.isEmpty(suffix)&& TextUtils.isEmpty(phoneticFamilyName)&& TextUtils.isEmpty(phoneticMiddleName)&& TextUtils.isEmpty(phoneticGivenName)&& TextUtils.isEmpty(displayName));
}
Program: 23479
Project: 23479
Buggy source:
public static boolean usesQuotedPrintable(int vcardType){
  return !isV30(vcardType);
}

Fixed version (ground truth):
public static boolean usesQuotedPrintable(final int vcardType){
  return !isV30(vcardType);
}
Program: 23480
Project: 23480
Buggy source:
public static int getVCardTypeFromString(String vcardTypeString){
  String loweredKey=vcardTypeString.toLowerCase();
  if (sVCardTypeMap.containsKey(loweredKey)) {
    return sVCardTypeMap.get(loweredKey);
  }
 else {
    Log.e(LOG_TAG,"String_Node_Str" + vcardTypeString + "String_Node_Str");
    return VCARD_TYPE_DEFAULT;
  }
}

Fixed version (ground truth):
public static int getVCardTypeFromString(final String vcardTypeString){
  final String loweredKey=vcardTypeString.toLowerCase();
  if (sVCardTypeMap.containsKey(loweredKey)) {
    return sVCardTypeMap.get(loweredKey);
  }
 else {
    Log.e(LOG_TAG,"String_Node_Str" + vcardTypeString + "String_Node_Str");
    return VCARD_TYPE_DEFAULT;
  }
}
Program: 23481
Project: 23481
Buggy source:
public static boolean usesAndroidSpecificProperty(int vcardType){
  return ((vcardType & FLAG_USE_ANDROID_PROPERTY) != 0);
}

Fixed version (ground truth):
public static boolean usesAndroidSpecificProperty(final int vcardType){
  return ((vcardType & FLAG_USE_ANDROID_PROPERTY) != 0);
}
Program: 23482
Project: 23482
Buggy source:
public static boolean appendTypeParamName(int vcardType){
  return (isV30(vcardType) || ((vcardType & FLAG_APPEND_TYPE_PARAM) != 0));
}

Fixed version (ground truth):
public static boolean appendTypeParamName(final int vcardType){
  return (isV30(vcardType) || ((vcardType & FLAG_APPEND_TYPE_PARAM) != 0));
}
Program: 23483
Project: 23483
Buggy source:
public static boolean refrainsQPToPrimaryProperties(int vcardType){
  return (!usesQuotedPrintable(vcardType) || ((vcardType & FLAG_REFRAIN_QP_TO_PRIMARY_PROPERTIES) != 0));
}

Fixed version (ground truth):
public static boolean refrainsQPToPrimaryProperties(final int vcardType){
  return (!usesQuotedPrintable(vcardType) || ((vcardType & FLAG_REFRAIN_QP_TO_PRIMARY_PROPERTIES) != 0));
}
Program: 23484
Project: 23484
Buggy source:
public static boolean isDoCoMo(int vcardType){
  return ((vcardType & FLAG_DOCOMO) != 0);
}

Fixed version (ground truth):
public static boolean isDoCoMo(final int vcardType){
  return ((vcardType & FLAG_DOCOMO) != 0);
}
Program: 23485
Project: 23485
Buggy source:
public static boolean usesShiftJis(int vcardType){
  return ((vcardType & FLAG_CHARSET_SHIFT_JIS) != 0);
}

Fixed version (ground truth):
public static boolean usesShiftJis(final int vcardType){
  return ((vcardType & FLAG_CHARSET_MASK) == FLAG_CHARSET_SHIFT_JIS);
}
Program: 23486
Project: 23486
Buggy source:
/** 
 * @return true if the device is Japanese and some Japanese convension isapplied to creating "formatted" something like FORMATTED_ADDRESS.
 */
public static boolean isJapaneseDevice(int vcardType){
  return sJapaneseMobileTypeSet.contains(vcardType);
}

Fixed version (ground truth):
/** 
 * @return true if the device is Japanese and some Japanese convension isapplied to creating "formatted" something like FORMATTED_ADDRESS.
 */
public static boolean isJapaneseDevice(final int vcardType){
  return sJapaneseMobileTypeSet.contains(vcardType);
}
Program: 23487
Project: 23487
Buggy source:
public static boolean usesUtf8(int vcardType){
  return ((vcardType & FLAG_CHARSET_UTF8) != 0);
}

Fixed version (ground truth):
public static boolean usesUtf8(final int vcardType){
  return ((vcardType & FLAG_CHARSET_MASK) == FLAG_CHARSET_UTF8);
}
Program: 23488
Project: 23488
Buggy source:
public static boolean isV30(int vcardType){
  return ((vcardType & FLAG_V30) != 0);
}

Fixed version (ground truth):
public static boolean isV30(final int vcardType){
  return ((vcardType & FLAG_V30) != 0);
}
Program: 23489
Project: 23489
Buggy source:
public static int getNameOrderType(int vcardType){
  return vcardType & NAME_ORDER_MASK;
}

Fixed version (ground truth):
public static int getNameOrderType(final int vcardType){
  return vcardType & NAME_ORDER_MASK;
}
Program: 23490
Project: 23490
Buggy source:
public static boolean needsToConvertPhoneticString(int vcardType){
  return ((vcardType & FLAG_CONVERT_PHONETIC_NAME_STRINGS) != 0);
}

Fixed version (ground truth):
public static boolean needsToConvertPhoneticString(final int vcardType){
  return ((vcardType & FLAG_CONVERT_PHONETIC_NAME_STRINGS) != 0);
}
Program: 23491
Project: 23491
Buggy source:
public static boolean onlyOneNoteFieldIsAvailable(int vcardType){
  return vcardType == VCARD_TYPE_DOCOMO;
}

Fixed version (ground truth):
public static boolean onlyOneNoteFieldIsAvailable(final int vcardType){
  return vcardType == VCARD_TYPE_DOCOMO;
}
Program: 23492
Project: 23492
Buggy source:
public static boolean usesDefactProperty(int vcardType){
  return ((vcardType & FLAG_USE_DEFACT_PROPERTY) != 0);
}

Fixed version (ground truth):
public static boolean usesDefactProperty(final int vcardType){
  return ((vcardType & FLAG_USE_DEFACT_PROPERTY) != 0);
}
Program: 23493
Project: 23493
Buggy source:
/** 
 * Some Japanese mobile phones use this field for phonetic name, since vCard 2.1 does not have "SORT-STRING" type. Also, in some cases, the field has some ';'s in it. Assume the ';' means the same meaning in N property
 */
@SuppressWarnings("String_Node_Str") private void handlePhoneticNameFromSound(List<String> elems){
  int size;
  if (elems == null || (size=elems.size()) < 1) {
    return;
  }
  if (size > 3) {
    size=3;
  }
switch (size) {
case 3:
    mPhoneticMiddleName=elems.get(2);
case 2:
  mPhoneticGivenName=elems.get(1);
default :
mPhoneticFamilyName=elems.get(0);
}
}

Fixed version (ground truth):
/** 
 * Some Japanese mobile phones use this field for phonetic name, since vCard 2.1 does not have "SORT-STRING" type. Also, in some cases, the field has some ';'s in it. Assume the ';' means the same meaning in N property
 */
@SuppressWarnings("String_Node_Str") private void handlePhoneticNameFromSound(List<String> elems){
  if (!(TextUtils.isEmpty(mPhoneticFamilyName) && TextUtils.isEmpty(mPhoneticMiddleName) && TextUtils.isEmpty(mPhoneticGivenName))) {
    return;
  }
  int size;
  if (elems == null || (size=elems.size()) < 1) {
    return;
  }
  if (size > 3) {
    size=3;
  }
  if (elems.get(0).length() > 0) {
    boolean onlyFirstElemIsNonEmpty=true;
    for (int i=1; i < size; i++) {
      if (elems.get(i).length() > 0) {
        onlyFirstElemIsNonEmpty=false;
        break;
      }
    }
    if (onlyFirstElemIsNonEmpty) {
      final String[] namesArray=elems.get(0).split("String_Node_Str");
      final int nameArrayLength=namesArray.length;
      if (nameArrayLength == 3) {
        mPhoneticFamilyName=namesArray[0];
        mPhoneticMiddleName=namesArray[1];
        mPhoneticGivenName=namesArray[2];
      }
 else       if (nameArrayLength == 2) {
        mPhoneticFamilyName=namesArray[0];
        mPhoneticGivenName=namesArray[1];
      }
 else {
        mPhoneticFullName=elems.get(0);
      }
      return;
    }
  }
switch (size) {
case 3:
    mPhoneticMiddleName=elems.get(2);
case 2:
  mPhoneticGivenName=elems.get(1);
default :
mPhoneticFamilyName=elems.get(0);
}
}
Program: 23494
Project: 23494
Buggy source:
/** 
 * Construct the display name. The constructed data must not be null.
 */
private void constructDisplayName(){
  if (!TextUtils.isEmpty(mFullName)) {
    mDisplayName=mFullName;
  }
 else   if (!(TextUtils.isEmpty(mFamilyName) && TextUtils.isEmpty(mGivenName))) {
    StringBuilder builder=new StringBuilder();
    List<String> nameList;
switch (VCardConfig.getNameOrderType(mVCardType)) {
case VCardConfig.NAME_ORDER_JAPANESE:
      if (VCardUtils.containsOnlyPrintableAscii(mFamilyName) && VCardUtils.containsOnlyPrintableAscii(mGivenName)) {
        nameList=Arrays.asList(mPrefix,mGivenName,mMiddleName,mFamilyName,mSuffix);
      }
 else {
        nameList=Arrays.asList(mPrefix,mFamilyName,mMiddleName,mGivenName,mSuffix);
      }
    break;
case VCardConfig.NAME_ORDER_EUROPE:
  nameList=Arrays.asList(mPrefix,mMiddleName,mGivenName,mFamilyName,mSuffix);
break;
default :
nameList=Arrays.asList(mPrefix,mGivenName,mMiddleName,mFamilyName,mSuffix);
break;
}
boolean first=true;
for (String namePart : nameList) {
if (!TextUtils.isEmpty(namePart)) {
if (first) {
first=false;
}
 else {
builder.append(' ');
}
builder.append(namePart);
}
}
mDisplayName=builder.toString();
}
 else if (!(TextUtils.isEmpty(mPhoneticFamilyName) && TextUtils.isEmpty(mPhoneticGivenName))) {
mDisplayName=VCardUtils.constructNameFromElements(mVCardType,mPhoneticFamilyName,mPhoneticMiddleName,mPhoneticGivenName);
}
 else if (mEmailList != null && mEmailList.size() > 0) {
mDisplayName=mEmailList.get(0).data;
}
 else if (mPhoneList != null && mPhoneList.size() > 0) {
mDisplayName=mPhoneList.get(0).data;
}
 else if (mPostalList != null && mPostalList.size() > 0) {
mDisplayName=mPostalList.get(0).getFormattedAddress(mVCardType);
}
if (mDisplayName == null) {
mDisplayName="String_Node_Str";
}
}

Fixed version (ground truth):
/** 
 * Construct the display name. The constructed data must not be null.
 */
private void constructDisplayName(){
  if (!TextUtils.isEmpty(mFullName)) {
    mDisplayName=mFullName;
  }
 else   if (!(TextUtils.isEmpty(mFamilyName) && TextUtils.isEmpty(mGivenName))) {
    mDisplayName=VCardUtils.constructNameFromElements(mVCardType,mFamilyName,mMiddleName,mGivenName,mPrefix,mSuffix);
  }
 else   if (!(TextUtils.isEmpty(mPhoneticFamilyName) && TextUtils.isEmpty(mPhoneticGivenName))) {
    mDisplayName=VCardUtils.constructNameFromElements(mVCardType,mPhoneticFamilyName,mPhoneticMiddleName,mPhoneticGivenName);
  }
 else   if (mEmailList != null && mEmailList.size() > 0) {
    mDisplayName=mEmailList.get(0).data;
  }
 else   if (mPhoneList != null && mPhoneList.size() > 0) {
    mDisplayName=mPhoneList.get(0).data;
  }
 else   if (mPostalList != null && mPostalList.size() > 0) {
    mDisplayName=mPostalList.get(0).getFormattedAddress(mVCardType);
  }
  if (mDisplayName == null) {
    mDisplayName="String_Node_Str";
  }
}
Program: 23495
Project: 23495
Buggy source:
/** 
 * Returns true when the property line should contain charset parameter information. This method may return true even when vCard version is 3.0. Strictly, adding charset information is invalid in VCard 3.0. However we'll add the info only when charset we use is not UTF-8 in vCard 3.0 format, since parser side may be able to use the charset via this field, though we may encounter another problem by adding it. e.g. Japanese mobile phones use Shift_Jis while RFC 2426 recommends UTF-8. By adding this field, parsers may be able to know this text is NOT UTF-8 but Shift_Jis.
 */
private boolean shouldAppendCharsetParameter(final String propertyValue){
  return (!VCardUtils.containsOnlyPrintableAscii(propertyValue) && (!mIsV30 || !mUsesUtf8));
}

Fixed version (ground truth):
/** 
 * Returns true when the property line should contain charset parameter information. This method may return true even when vCard version is 3.0. Strictly, adding charset information is invalid in VCard 3.0. However we'll add the info only when charset we use is not UTF-8 in vCard 3.0 format, since parser side may be able to use the charset via this field, though we may encounter another problem by adding it. e.g. Japanese mobile phones use Shift_Jis while RFC 2426 recommends UTF-8. By adding this field, parsers may be able to know this text is NOT UTF-8 but Shift_Jis.
 */
private boolean shouldAppendCharsetParameter(final String propertyValue){
  return (!(mIsV30 && mUsesUtf8) && !VCardUtils.containsOnlyPrintableAscii(propertyValue));
}
Program: 23496
Project: 23496
Buggy source:
private boolean containsNonEmptyName(ContentValues contentValues){
  final String familyName=contentValues.getAsString(StructuredName.FAMILY_NAME);
  final String middleName=contentValues.getAsString(StructuredName.MIDDLE_NAME);
  final String givenName=contentValues.getAsString(StructuredName.GIVEN_NAME);
  final String prefix=contentValues.getAsString(StructuredName.PREFIX);
  final String suffix=contentValues.getAsString(StructuredName.SUFFIX);
  final String displayName=contentValues.getAsString(StructuredName.DISPLAY_NAME);
  return !(TextUtils.isEmpty(familyName) && TextUtils.isEmpty(middleName) && TextUtils.isEmpty(givenName)&& TextUtils.isEmpty(prefix)&& TextUtils.isEmpty(suffix)&& TextUtils.isEmpty(displayName));
}

Fixed version (ground truth):
private boolean containsNonEmptyName(ContentValues contentValues){
  final String familyName=contentValues.getAsString(StructuredName.FAMILY_NAME);
  final String middleName=contentValues.getAsString(StructuredName.MIDDLE_NAME);
  final String givenName=contentValues.getAsString(StructuredName.GIVEN_NAME);
  final String prefix=contentValues.getAsString(StructuredName.PREFIX);
  final String suffix=contentValues.getAsString(StructuredName.SUFFIX);
  final String phoneticFamilyName=contentValues.getAsString(StructuredName.PHONETIC_FAMILY_NAME);
  final String phoneticMiddleName=contentValues.getAsString(StructuredName.PHONETIC_MIDDLE_NAME);
  final String phoneticGivenName=contentValues.getAsString(StructuredName.PHONETIC_GIVEN_NAME);
  final String displayName=contentValues.getAsString(StructuredName.DISPLAY_NAME);
  return !(TextUtils.isEmpty(familyName) && TextUtils.isEmpty(middleName) && TextUtils.isEmpty(givenName)&& TextUtils.isEmpty(prefix)&& TextUtils.isEmpty(suffix)&& TextUtils.isEmpty(phoneticFamilyName)&& TextUtils.isEmpty(phoneticMiddleName)&& TextUtils.isEmpty(phoneticGivenName)&& TextUtils.isEmpty(displayName));
}
Program: 23498
Project: 23498
Buggy source:
public static boolean usesQuotedPrintable(int vcardType){
  return !isV30(vcardType);
}

Fixed version (ground truth):
public static boolean usesQuotedPrintable(final int vcardType){
  return !isV30(vcardType);
}
Program: 23499
Project: 23499
Buggy source:
public static int getVCardTypeFromString(String vcardTypeString){
  String loweredKey=vcardTypeString.toLowerCase();
  if (sVCardTypeMap.containsKey(loweredKey)) {
    return sVCardTypeMap.get(loweredKey);
  }
 else {
    Log.e(LOG_TAG,"String_Node_Str" + vcardTypeString + "String_Node_Str");
    return VCARD_TYPE_DEFAULT;
  }
}

Fixed version (ground truth):
public static int getVCardTypeFromString(final String vcardTypeString){
  final String loweredKey=vcardTypeString.toLowerCase();
  if (sVCardTypeMap.containsKey(loweredKey)) {
    return sVCardTypeMap.get(loweredKey);
  }
 else {
    Log.e(LOG_TAG,"String_Node_Str" + vcardTypeString + "String_Node_Str");
    return VCARD_TYPE_DEFAULT;
  }
}
Program: 23500
Project: 23500
Buggy source:
public static boolean usesAndroidSpecificProperty(int vcardType){
  return ((vcardType & FLAG_USE_ANDROID_PROPERTY) != 0);
}

Fixed version (ground truth):
public static boolean usesAndroidSpecificProperty(final int vcardType){
  return ((vcardType & FLAG_USE_ANDROID_PROPERTY) != 0);
}
Program: 23501
Project: 23501
Buggy source:
public static boolean appendTypeParamName(int vcardType){
  return (isV30(vcardType) || ((vcardType & FLAG_APPEND_TYPE_PARAM) != 0));
}

Fixed version (ground truth):
public static boolean appendTypeParamName(final int vcardType){
  return (isV30(vcardType) || ((vcardType & FLAG_APPEND_TYPE_PARAM) != 0));
}
Program: 23502
Project: 23502
Buggy source:
public static boolean refrainsQPToPrimaryProperties(int vcardType){
  return (!usesQuotedPrintable(vcardType) || ((vcardType & FLAG_REFRAIN_QP_TO_PRIMARY_PROPERTIES) != 0));
}

Fixed version (ground truth):
public static boolean refrainsQPToPrimaryProperties(final int vcardType){
  return (!usesQuotedPrintable(vcardType) || ((vcardType & FLAG_REFRAIN_QP_TO_PRIMARY_PROPERTIES) != 0));
}
Program: 23503
Project: 23503
Buggy source:
public static boolean isDoCoMo(int vcardType){
  return ((vcardType & FLAG_DOCOMO) != 0);
}

Fixed version (ground truth):
public static boolean isDoCoMo(final int vcardType){
  return ((vcardType & FLAG_DOCOMO) != 0);
}
Program: 23504
Project: 23504
Buggy source:
public static boolean usesShiftJis(int vcardType){
  return ((vcardType & FLAG_CHARSET_SHIFT_JIS) != 0);
}

Fixed version (ground truth):
public static boolean usesShiftJis(final int vcardType){
  return ((vcardType & FLAG_CHARSET_MASK) == FLAG_CHARSET_SHIFT_JIS);
}
Program: 23505
Project: 23505
Buggy source:
/** 
 * @return true if the device is Japanese and some Japanese convension isapplied to creating "formatted" something like FORMATTED_ADDRESS.
 */
public static boolean isJapaneseDevice(int vcardType){
  return sJapaneseMobileTypeSet.contains(vcardType);
}

Fixed version (ground truth):
/** 
 * @return true if the device is Japanese and some Japanese convension isapplied to creating "formatted" something like FORMATTED_ADDRESS.
 */
public static boolean isJapaneseDevice(final int vcardType){
  return sJapaneseMobileTypeSet.contains(vcardType);
}
Program: 23506
Project: 23506
Buggy source:
public static boolean usesUtf8(int vcardType){
  return ((vcardType & FLAG_CHARSET_UTF8) != 0);
}

Fixed version (ground truth):
public static boolean usesUtf8(final int vcardType){
  return ((vcardType & FLAG_CHARSET_MASK) == FLAG_CHARSET_UTF8);
}
Program: 23507
Project: 23507
Buggy source:
public static boolean isV30(int vcardType){
  return ((vcardType & FLAG_V30) != 0);
}

Fixed version (ground truth):
public static boolean isV30(final int vcardType){
  return ((vcardType & FLAG_V30) != 0);
}
Program: 23508
Project: 23508
Buggy source:
public static int getNameOrderType(int vcardType){
  return vcardType & NAME_ORDER_MASK;
}

Fixed version (ground truth):
public static int getNameOrderType(final int vcardType){
  return vcardType & NAME_ORDER_MASK;
}
Program: 23509
Project: 23509
Buggy source:
public static boolean needsToConvertPhoneticString(int vcardType){
  return ((vcardType & FLAG_CONVERT_PHONETIC_NAME_STRINGS) != 0);
}

Fixed version (ground truth):
public static boolean needsToConvertPhoneticString(final int vcardType){
  return ((vcardType & FLAG_CONVERT_PHONETIC_NAME_STRINGS) != 0);
}
Program: 23510
Project: 23510
Buggy source:
public static boolean onlyOneNoteFieldIsAvailable(int vcardType){
  return vcardType == VCARD_TYPE_DOCOMO;
}

Fixed version (ground truth):
public static boolean onlyOneNoteFieldIsAvailable(final int vcardType){
  return vcardType == VCARD_TYPE_DOCOMO;
}
Program: 23511
Project: 23511
Buggy source:
public static boolean usesDefactProperty(int vcardType){
  return ((vcardType & FLAG_USE_DEFACT_PROPERTY) != 0);
}

Fixed version (ground truth):
public static boolean usesDefactProperty(final int vcardType){
  return ((vcardType & FLAG_USE_DEFACT_PROPERTY) != 0);
}
Program: 23512
Project: 23512
Buggy source:
public Bitmap peekWallpaperBitmap(Context context,boolean returnDefault){
synchronized (this) {
    if (mWallpaper != null) {
      return mWallpaper;
    }
    if (mDefaultWallpaper != null) {
      return mDefaultWallpaper;
    }
    mWallpaper=getCurrentWallpaperLocked(context);
    if (mWallpaper == null && returnDefault) {
      mDefaultWallpaper=getDefaultWallpaperLocked(context);
      return mDefaultWallpaper;
    }
    return mWallpaper;
  }
}

Fixed version (ground truth):
public Bitmap peekWallpaperBitmap(Context context,boolean returnDefault){
synchronized (this) {
    if (mWallpaper != null) {
      return mWallpaper;
    }
    if (mDefaultWallpaper != null) {
      return mDefaultWallpaper;
    }
    mWallpaper=null;
    try {
      mWallpaper=getCurrentWallpaperLocked(context);
    }
 catch (    OutOfMemoryError e) {
      Log.w(TAG,"String_Node_Str",e);
    }
    if (mWallpaper == null && returnDefault) {
      mDefaultWallpaper=getDefaultWallpaperLocked(context);
      return mDefaultWallpaper;
    }
    return mWallpaper;
  }
}
Program: 23513
Project: 23513
Buggy source:
private Bitmap getDefaultWallpaperLocked(Context context){
  try {
    InputStream is=context.getResources().openRawResource(com.android.internal.R.drawable.default_wallpaper);
    if (is != null) {
      int width=mService.getWidthHint();
      int height=mService.getHeightHint();
      if (width <= 0 || height <= 0) {
        Bitmap bm=BitmapFactory.decodeStream(is,null,null);
        try {
          is.close();
        }
 catch (        IOException e) {
        }
        if (bm != null) {
          bm.setDensity(DisplayMetrics.DENSITY_DEVICE);
        }
        return bm;
      }
      BitmapFactory.Options options=new BitmapFactory.Options();
      options.inDither=false;
      options.inPreferredConfig=Bitmap.Config.ARGB_8888;
      Bitmap bm=BitmapFactory.decodeStream(is,null,options);
      try {
        is.close();
      }
 catch (      IOException e) {
      }
      return generateBitmap(context,bm,width,height);
    }
  }
 catch (  RemoteException e) {
  }
  return null;
}

Fixed version (ground truth):
private Bitmap getDefaultWallpaperLocked(Context context){
  try {
    InputStream is=context.getResources().openRawResource(com.android.internal.R.drawable.default_wallpaper);
    if (is != null) {
      int width=mService.getWidthHint();
      int height=mService.getHeightHint();
      if (width <= 0 || height <= 0) {
        Bitmap bm=BitmapFactory.decodeStream(is,null,null);
        try {
          is.close();
        }
 catch (        IOException e) {
        }
        if (bm != null) {
          bm.setDensity(DisplayMetrics.DENSITY_DEVICE);
        }
        return bm;
      }
      BitmapFactory.Options options=new BitmapFactory.Options();
      options.inDither=false;
      options.inPreferredConfig=Bitmap.Config.ARGB_8888;
      Bitmap bm=BitmapFactory.decodeStream(is,null,options);
      try {
        is.close();
      }
 catch (      IOException e) {
      }
      try {
        return generateBitmap(context,bm,width,height);
      }
 catch (      OutOfMemoryError e) {
        Log.w(TAG,"String_Node_Str",e);
        return bm;
      }
    }
  }
 catch (  RemoteException e) {
  }
  return null;
}
Program: 23514
Project: 23514
Buggy source:
void drawFrame(){
  SurfaceHolder sh=getSurfaceHolder();
  Canvas c=sh.lockCanvas();
  if (c != null) {
    final Rect frame=sh.getSurfaceFrame();
synchronized (mLock) {
      final Drawable background=mBackground;
      final int dw=frame.width();
      final int dh=frame.height();
      final int bw=mBackground.getIntrinsicWidth();
      final int bh=mBackground.getIntrinsicHeight();
      final int availw=dw - bw;
      final int availh=dh - bh;
      int xPixels=availw < 0 ? (int)(availw * mXOffset + .5f) : (availw / 2);
      int yPixels=availh < 0 ? (int)(availh * mYOffset + .5f) : (availh / 2);
      c.translate(xPixels,yPixels);
      if (availw < 0 || availh < 0) {
        c.save(Canvas.CLIP_SAVE_FLAG);
        c.clipRect(0,0,bw,bh,Op.DIFFERENCE);
        c.drawColor(0xff000000);
        c.restore();
      }
      background.draw(c);
    }
    sh.unlockCanvasAndPost(c);
  }
}

Fixed version (ground truth):
void drawFrame(){
  SurfaceHolder sh=getSurfaceHolder();
  Canvas c=sh.lockCanvas();
  if (c != null) {
    final Rect frame=sh.getSurfaceFrame();
synchronized (mLock) {
      final Drawable background=mBackground;
      final int dw=frame.width();
      final int dh=frame.height();
      final int bw=background != null ? background.getIntrinsicWidth() : 0;
      final int bh=background != null ? background.getIntrinsicHeight() : 0;
      final int availw=dw - bw;
      final int availh=dh - bh;
      int xPixels=availw < 0 ? (int)(availw * mXOffset + .5f) : (availw / 2);
      int yPixels=availh < 0 ? (int)(availh * mYOffset + .5f) : (availh / 2);
      c.translate(xPixels,yPixels);
      if (availw < 0 || availh < 0) {
        c.save(Canvas.CLIP_SAVE_FLAG);
        c.clipRect(0,0,bw,bh,Op.DIFFERENCE);
        c.drawColor(0xff000000);
        c.restore();
      }
      if (background != null) {
        background.draw(c);
      }
    }
    sh.unlockCanvasAndPost(c);
  }
}
Program: 23515
Project: 23515
Buggy source:
void updateWallpaper(){
synchronized (mLock) {
    mBackground=mWallpaperManager.getFastDrawable();
  }
}

Fixed version (ground truth):
void updateWallpaper(){
synchronized (mLock) {
    try {
      mBackground=mWallpaperManager.getFastDrawable();
    }
 catch (    RuntimeException e) {
      Log.w("String_Node_Str","String_Node_Str",e);
    }
  }
}
Program: 23516
Project: 23516
Buggy source:
public int getMaxPacketSize(){
  return mMaxPacketSize - 6;
}

Fixed version (ground truth):
public int getMaxPacketSize(){
  return mMaxPacketSize - 6 - getHeaderLength();
}
Program: 23517
Project: 23517
Buggy source:
/** 
 * Open and return an output stream for a connection.
 * @return an output stream
 * @throws IOException if an I/O error occurs
 */
public OutputStream openOutputStream() throws IOException {
  ensureOpen();
  ensureNotDone();
  if (mPrivateOutputOpen)   throw new IOException("String_Node_Str");
  if (mPrivateOutput == null) {
    mPrivateOutput=new PrivateOutputStream(this,mMaxPacketSize - 6);
  }
  mPrivateOutputOpen=true;
  return mPrivateOutput;
}

Fixed version (ground truth):
/** 
 * Open and return an output stream for a connection.
 * @return an output stream
 * @throws IOException if an I/O error occurs
 */
public OutputStream openOutputStream() throws IOException {
  ensureOpen();
  ensureNotDone();
  if (mPrivateOutputOpen)   throw new IOException("String_Node_Str");
  if (mPrivateOutput == null) {
    mPrivateOutput=new PrivateOutputStream(this,getMaxPacketSize());
  }
  mPrivateOutputOpen=true;
  return mPrivateOutput;
}
Program: 23518
Project: 23518
Buggy source:
public int getMaxPacketSize(){
  return mMaxPacketLength - 6;
}

Fixed version (ground truth):
public int getMaxPacketSize(){
  return mMaxPacketLength - 6 - getHeaderLength();
}
Program: 23519
Project: 23519
Buggy source:
/** 
 * Open and return an output stream for a connection.
 * @return an output stream
 * @throws IOException if an I/O error occurs
 */
public OutputStream openOutputStream() throws IOException {
  ensureOpen();
  if (mPrivateOutputOpen) {
    throw new IOException("String_Node_Str");
  }
  if (!mRequestFinished) {
    throw new IOException("String_Node_Str");
  }
  if (mPrivateOutput == null) {
    mPrivateOutput=new PrivateOutputStream(this,mMaxPacketLength - 6);
  }
  mPrivateOutputOpen=true;
  return mPrivateOutput;
}

Fixed version (ground truth):
/** 
 * Open and return an output stream for a connection.
 * @return an output stream
 * @throws IOException if an I/O error occurs
 */
public OutputStream openOutputStream() throws IOException {
  ensureOpen();
  if (mPrivateOutputOpen) {
    throw new IOException("String_Node_Str");
  }
  if (!mRequestFinished) {
    throw new IOException("String_Node_Str");
  }
  if (mPrivateOutput == null) {
    mPrivateOutput=new PrivateOutputStream(this,getMaxPacketSize());
  }
  mPrivateOutputOpen=true;
  return mPrivateOutput;
}
Program: 23523
Project: 23523
Buggy source:
private final void handleCreateService(CreateServiceData data){
  unscheduleGcIdler();
  PackageInfo packageInfo=getPackageInfoNoCheck(data.info.applicationInfo);
  Service service=null;
  try {
    java.lang.ClassLoader cl=packageInfo.getClassLoader();
    service=(Service)cl.loadClass(data.info.name).newInstance();
  }
 catch (  Exception e) {
    if (!mInstrumentation.onException(service,e)) {
      throw new RuntimeException("String_Node_Str" + data.info.name + "String_Node_Str"+ e.toString(),e);
    }
  }
  try {
    if (localLOGV)     Log.v(TAG,"String_Node_Str" + data.info.name);
    ApplicationContext context=new ApplicationContext();
    context.init(packageInfo,null,this);
    Application app=packageInfo.makeApplication(false);
    context.setOuterContext(service);
    service.attach(context,this,data.info.name,data.token,app,ActivityManagerNative.getDefault());
    service.onCreate();
    mServices.put(data.token,service);
    try {
      ActivityManagerNative.getDefault().serviceDoneExecuting(data.token,0,0,0);
    }
 catch (    RemoteException e) {
    }
  }
 catch (  Exception e) {
    if (!mInstrumentation.onException(service,e)) {
      throw new RuntimeException("String_Node_Str" + data.info.name + "String_Node_Str"+ e.toString(),e);
    }
  }
}

Fixed version (ground truth):
private final void handleCreateService(CreateServiceData data){
  unscheduleGcIdler();
  PackageInfo packageInfo=getPackageInfoNoCheck(data.info.applicationInfo);
  Service service=null;
  try {
    java.lang.ClassLoader cl=packageInfo.getClassLoader();
    service=(Service)cl.loadClass(data.info.name).newInstance();
  }
 catch (  Exception e) {
    if (!mInstrumentation.onException(service,e)) {
      throw new RuntimeException("String_Node_Str" + data.info.name + "String_Node_Str"+ e.toString(),e);
    }
  }
  try {
    if (localLOGV)     Log.v(TAG,"String_Node_Str" + data.info.name);
    ApplicationContext context=new ApplicationContext();
    context.init(packageInfo,null,this);
    Application app=packageInfo.makeApplication(false,mInstrumentation);
    context.setOuterContext(service);
    service.attach(context,this,data.info.name,data.token,app,ActivityManagerNative.getDefault());
    service.onCreate();
    mServices.put(data.token,service);
    try {
      ActivityManagerNative.getDefault().serviceDoneExecuting(data.token,0,0,0);
    }
 catch (    RemoteException e) {
    }
  }
 catch (  Exception e) {
    if (!mInstrumentation.onException(service,e)) {
      throw new RuntimeException("String_Node_Str" + data.info.name + "String_Node_Str"+ e.toString(),e);
    }
  }
}
Program: 23526
Project: 23526
Buggy source:
public Application makeApplication(boolean forceDefaultAppClass){
  if (mApplication != null) {
    return mApplication;
  }
  Application app=null;
  String appClass=mApplicationInfo.className;
  if (forceDefaultAppClass || (appClass == null)) {
    appClass="String_Node_Str";
  }
  try {
    java.lang.ClassLoader cl=getClassLoader();
    ApplicationContext appContext=new ApplicationContext();
    appContext.init(this,null,mActivityThread);
    app=mActivityThread.mInstrumentation.newApplication(cl,appClass,appContext);
    appContext.setOuterContext(app);
  }
 catch (  Exception e) {
    if (!mActivityThread.mInstrumentation.onException(app,e)) {
      throw new RuntimeException("String_Node_Str" + appClass + "String_Node_Str"+ e.toString(),e);
    }
  }
  mActivityThread.mAllApplications.add(app);
  return mApplication=app;
}

Fixed version (ground truth):
public Application makeApplication(boolean forceDefaultAppClass,Instrumentation instrumentation){
  if (mApplication != null) {
    return mApplication;
  }
  Application app=null;
  String appClass=mApplicationInfo.className;
  if (forceDefaultAppClass || (appClass == null)) {
    appClass="String_Node_Str";
  }
  try {
    java.lang.ClassLoader cl=getClassLoader();
    ApplicationContext appContext=new ApplicationContext();
    appContext.init(this,null,mActivityThread);
    app=mActivityThread.mInstrumentation.newApplication(cl,appClass,appContext);
    appContext.setOuterContext(app);
  }
 catch (  Exception e) {
    if (!mActivityThread.mInstrumentation.onException(app,e)) {
      throw new RuntimeException("String_Node_Str" + appClass + "String_Node_Str"+ e.toString(),e);
    }
  }
  mActivityThread.mAllApplications.add(app);
  mApplication=app;
  if (instrumentation != null) {
    try {
      instrumentation.callApplicationOnCreate(app);
    }
 catch (    Exception e) {
      if (!instrumentation.onException(app,e)) {
        throw new RuntimeException("String_Node_Str" + app.getClass().getName() + "String_Node_Str"+ e.toString(),e);
      }
    }
  }
  return app;
}
Program: 23527
Project: 23527
Buggy source:
public void start(GLThread thread) throws InterruptedException {
  GLThread oldThread=null;
synchronized (this) {
    mMostRecentGLThread=thread;
    oldThread=mMostRecentGLThread;
  }
  if (oldThread != null) {
synchronized (oldThread) {
      oldThread.notifyAll();
    }
  }
  sEglSemaphore.acquire();
}

Fixed version (ground truth):
public void start(GLThread thread) throws InterruptedException {
  GLThread oldThread=null;
synchronized (this) {
    oldThread=mMostRecentGLThread;
    mMostRecentGLThread=thread;
  }
  if (oldThread != null) {
synchronized (oldThread) {
      oldThread.notifyAll();
    }
  }
  sEglSemaphore.acquire();
}
Program: 23528
Project: 23528
Buggy source:
/** 
 * Calculate the message text encoding length, fragmentation, and other details.
 * @param force ignore (but still count) illegal characters if true
 * @return septet count, or -1 on failure
 */
public static TextEncodingDetails calcTextEncodingDetails(CharSequence msg,boolean force7BitEncoding){
  TextEncodingDetails ted;
  int septets=countAsciiSeptets(msg,force7BitEncoding);
  if (septets != -1 && septets <= SmsMessage.MAX_USER_DATA_SEPTETS) {
    ted=new TextEncodingDetails();
    ted.msgCount=1;
    ted.codeUnitCount=septets;
    ted.codeUnitsRemaining=SmsMessage.MAX_USER_DATA_SEPTETS - septets;
    ted.codeUnitSize=SmsMessage.ENCODING_7BIT;
  }
 else {
    ted=com.android.internal.telephony.gsm.SmsMessage.calculateLength(msg,force7BitEncoding);
  }
  return ted;
}

Fixed version (ground truth):
/** 
 * Calculate the message text encoding length, fragmentation, and other details.
 * @param force ignore (but still count) illegal characters if true
 * @return septet count, or -1 on failure
 */
public static TextEncodingDetails calcTextEncodingDetails(CharSequence msg,boolean force7BitEncoding){
  TextEncodingDetails ted;
  int septets=countAsciiSeptets(msg,force7BitEncoding);
  if (septets != -1 && septets <= SmsMessage.MAX_USER_DATA_SEPTETS) {
    ted=new TextEncodingDetails();
    ted.msgCount=1;
    ted.codeUnitCount=septets;
    ted.codeUnitsRemaining=SmsMessage.MAX_USER_DATA_SEPTETS - septets;
    ted.codeUnitSize=SmsMessage.ENCODING_7BIT;
  }
 else {
    ted=com.android.internal.telephony.gsm.SmsMessage.calculateLength(msg,force7BitEncoding);
    if (ted.msgCount == 1 && ted.codeUnitSize == SmsMessage.ENCODING_7BIT) {
      ted.codeUnitCount=msg.length();
      int octets=ted.codeUnitCount * 2;
      if (octets > MAX_USER_DATA_BYTES) {
        ted.msgCount=(octets / MAX_USER_DATA_BYTES_WITH_HEADER) + 1;
        ted.codeUnitsRemaining=(MAX_USER_DATA_BYTES_WITH_HEADER - (octets % MAX_USER_DATA_BYTES_WITH_HEADER)) / 2;
      }
 else {
        ted.msgCount=1;
        ted.codeUnitsRemaining=(MAX_USER_DATA_BYTES - octets) / 2;
      }
      ted.codeUnitSize=ENCODING_16BIT;
    }
  }
  return ted;
}