nus-yam/ex-repair huggingface dataset:
Program: 187915
Project: 187915
Buggy source:
@Override public boolean onCreateOptionsMenu(Menu menu){
  super.onCreateOptionsMenu(menu);
  menu.add(0,MENU_NEW_LIST,0,R.string.new_list).setIcon(R.drawable.shoppinglistnew001b).setShortcut('0','n');
  menu.add(0,MENU_CLEAN_UP_LIST,0,R.string.clean_up_list).setIcon(R.drawable.shoppinglistcleanup001b).setShortcut('1','c');
  menu.add(0,MENU_RENAME_LIST,0,R.string.rename_list).setIcon(R.drawable.shoppinglistrename001b).setShortcut('2','r');
  ;
  menu.add(0,MENU_DELETE_LIST,0,R.string.delete_list).setIcon(R.drawable.shoppinglistdelete001b).setShortcut('3','d');
  menu.add(0,MENU_SHARE,0,R.string.share).setIcon(R.drawable.contact_share001a).setShortcut('4','s');
  menu.add(0,MENU_THEME,0,R.string.theme).setIcon(R.drawable.shoppinglisttheme001a).setShortcut('5','t');
  menu.add(0,MENU_ADD_LOCATION_ALERT,0,R.string.shopping_add_alert).setIcon(R.drawable.locations_add_alert001a).setShortcut('6','l');
  menu.add(0,MENU_SENSOR_SERVICE,0,R.string.shake_control).setIcon(R.drawable.mobile_shake001a).setShortcut('0','s');
  return true;
}

Fixed version (ground truth):
@Override public boolean onCreateOptionsMenu(Menu menu){
  super.onCreateOptionsMenu(menu);
  menu.add(0,MENU_NEW_LIST,0,R.string.new_list).setIcon(R.drawable.shoppinglistnew001b).setShortcut('0','n');
  menu.add(0,MENU_CLEAN_UP_LIST,0,R.string.clean_up_list).setIcon(R.drawable.shoppinglistcleanup001b).setShortcut('1','c');
  menu.add(0,MENU_RENAME_LIST,0,R.string.rename_list).setIcon(R.drawable.shoppinglistrename001b).setShortcut('2','r');
  ;
  menu.add(0,MENU_DELETE_LIST,0,R.string.delete_list).setIcon(R.drawable.shoppinglistdelete001b).setShortcut('3','d');
  menu.add(0,MENU_THEME,0,R.string.theme).setIcon(R.drawable.shoppinglisttheme001a).setShortcut('5','t');
  menu.add(0,MENU_ADD_LOCATION_ALERT,0,R.string.shopping_add_alert).setIcon(R.drawable.locations_add_alert001a).setShortcut('6','l');
  menu.add(0,MENU_SENSOR_SERVICE,0,R.string.shake_control).setIcon(R.drawable.mobile_shake001a).setShortcut('0','s');
  return true;
}
Program: 187918
Project: 187918
Buggy source:
@Override protected int deleteInternal(Uri uri,String selection,String[] selectionArgs){
  int res=0;
  String alertID="String_Node_Str";
  int match=URL_MATCHER.match(uri);
  Log.d(this.TAG,"String_Node_Str" + match + "String_Node_Str");
  long rowID=0;
switch (match) {
case ALERT_GENERIC:
    res=getDatabase().delete(TABLE_ALERTS,selection,selectionArgs);
  break;
case ALERT_GENERIC_ID:
alertID=uri.getPathSegments().get(1);
res=getDatabase().delete(TABLE_ALERTS,"String_Node_Str" + alertID + (!TextUtils.isEmpty(selection) ? "String_Node_Str" + selection + ')' : "String_Node_Str"),selectionArgs);
break;
case ALERT_LOCATION:
res=getDatabase().delete(TABLE_ALERTS,selection,selectionArgs);
break;
case ALERT_LOCATION_ID:
alertID=uri.getPathSegments().get(1);
res=getDatabase().delete(TABLE_ALERTS,"String_Node_Str" + alertID + (!TextUtils.isEmpty(selection) ? "String_Node_Str" + selection + ')' : "String_Node_Str"),selectionArgs);
break;
case MANAGED_SERVICE:
res=getDatabase().delete(TABLE_SERVICES,selection,selectionArgs);
break;
case MANAGED_SERVICE_ID:
alertID=uri.getPathSegments().get(1);
res=getDatabase().delete(TABLE_SERVICES,"String_Node_Str" + alertID + (!TextUtils.isEmpty(selection) ? "String_Node_Str" + selection + ')' : "String_Node_Str"),selectionArgs);
break;
}
getContext().getContentResolver().notifyChange(uri,null);
return res;
}

Fixed version (ground truth):
@Override protected int deleteInternal(Uri uri,String selection,String[] selectionArgs){
  int res=0;
  String alertID="String_Node_Str";
  int match=URL_MATCHER.match(uri);
  Log.d(this.TAG,"String_Node_Str" + match + "String_Node_Str");
  long rowID=0;
switch (match) {
case ALERT_GENERIC:
    res=getDatabase().delete(TABLE_ALERTS,selection,selectionArgs);
  break;
case ALERT_GENERIC_ID:
alertID=uri.getPathSegments().get(1);
res=getDatabase().delete(TABLE_ALERTS,"String_Node_Str" + alertID + (!TextUtils.isEmpty(selection) ? "String_Node_Str" + selection + ')' : "String_Node_Str"),selectionArgs);
break;
case ALERT_LOCATION:
res=getDatabase().delete(TABLE_ALERTS,selection,selectionArgs);
break;
case ALERT_LOCATION_ID:
alertID=uri.getPathSegments().get(1);
res=getDatabase().delete(TABLE_ALERTS,"String_Node_Str" + alertID + (!TextUtils.isEmpty(selection) ? "String_Node_Str" + selection + ')' : "String_Node_Str"),selectionArgs);
break;
case ALERT_DATE_TIME:
res=getDatabase().delete(TABLE_ALERTS,selection,selectionArgs);
break;
case ALERT_DATE_TIME_ID:
alertID=uri.getPathSegments().get(1);
res=getDatabase().delete(TABLE_ALERTS,"String_Node_Str" + alertID + (!TextUtils.isEmpty(selection) ? "String_Node_Str" + selection + ')' : "String_Node_Str"),selectionArgs);
break;
case MANAGED_SERVICE:
res=getDatabase().delete(TABLE_SERVICES,selection,selectionArgs);
break;
case MANAGED_SERVICE_ID:
alertID=uri.getPathSegments().get(1);
res=getDatabase().delete(TABLE_SERVICES,"String_Node_Str" + alertID + (!TextUtils.isEmpty(selection) ? "String_Node_Str" + selection + ')' : "String_Node_Str"),selectionArgs);
break;
}
getContext().getContentResolver().notifyChange(uri,null);
return res;
}
Program: 187921
Project: 187921
Buggy source:
@Override protected void onResume(){
  super.onResume();
  if (mState == STATE_MAIN || mState == STATE_VIEW_LIST) {
    setTitle(getText(R.string.shopping_list));
  }
 else   if ((mState == STATE_PICK_ITEM) || (mState == STATE_GET_CONTENT_ITEM)) {
    setTitle(getText(R.string.pick_item));
    setTitleColor(0xFFAAAAFF);
  }
  checkListLength();
  if (!mUpdating) {
    mUpdating=true;
  }
  if (mGTalkSender != null) {
    bindGTalkIfNeeded();
  }
  IntentFilter intentfilter=new IntentFilter(OpenIntents.REFRESH_ACTION);
  registerReceiver(mIntentReceiver,intentfilter);
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  Log.i(TAG,"String_Node_Str");
  if (mState == STATE_MAIN || mState == STATE_VIEW_LIST) {
    setTitle(getText(R.string.shopping_list));
  }
 else   if ((mState == STATE_PICK_ITEM) || (mState == STATE_GET_CONTENT_ITEM)) {
    setTitle(getText(R.string.pick_item));
    setTitleColor(0xFFAAAAFF);
  }
  checkListLength();
  if (!mUpdating) {
    mUpdating=true;
  }
  if (mGTalkSender != null) {
    bindGTalkIfNeeded();
  }
  IntentFilter intentfilter=new IntentFilter(OpenIntents.REFRESH_ACTION);
  registerReceiver(mIntentReceiver,intentfilter);
}
Program: 187922
Project: 187922
Buggy source:
@Override protected void onFreeze(Bundle outState){
  super.onFreeze(outState);
  String s=mEditText.getText().toString();
  outState.putString(ORIGINAL_ITEM,s);
  mUpdating=false;
  if (mGTalkSender != null) {
    mGTalkSender.unbindGTalkService();
  }
}

Fixed version (ground truth):
@Override protected void onFreeze(Bundle outState){
  super.onFreeze(outState);
  Log.i(TAG,"String_Node_Str");
  String s=mEditText.getText().toString();
  outState.putString(ORIGINAL_ITEM,s);
  mUpdating=false;
}
Program: 187923
Project: 187923
Buggy source:
@Override protected void onPause(){
  super.onPause();
  unregisterReceiver(mIntentReceiver);
}

Fixed version (ground truth):
@Override protected void onPause(){
  super.onPause();
  Log.i(TAG,"String_Node_Str");
  unregisterReceiver(mIntentReceiver);
  if (mGTalkSender != null) {
    mGTalkSender.unbindGTalkService();
  }
}
Program: 187925
Project: 187925
Buggy source:
/** 
 * Rename item from dialog.
 * @return true if new list was renamed. False if new list was not renamed, because user has not given any name.
 */
private boolean renameItem(){
  EditText edittext=(EditText)mDialog.findViewById(R.id.edittext);
  String s=edittext.getText().toString();
  if (s.equals("String_Node_Str")) {
    Toast.makeText(this,getString(R.string.please_enter_name),Toast.LENGTH_SHORT).show();
    return false;
  }
  String oldItemName=mCursorItems.getString(mStringItemsITEMNAME);
  String newItemName=s;
  mCursorItems.updateString(mStringItemsITEMNAME,newItemName);
  mCursorItems.commitUpdates();
  mCursorItems.requery();
  edittext.setText("String_Node_Str");
  String recipients=mCursorListFilter.getString(mStringListFilterSHARECONTACTS);
  if (!recipients.equals("String_Node_Str")) {
    String shareName=mCursorListFilter.getString(mStringListFilterSHARENAME);
    long status=mCursorItems.getLong(mStringItemsSTATUS);
    mGTalkSender.sendItemUpdate(recipients,shareName,oldItemName,newItemName,status,status);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Rename item from dialog.
 * @return true if new list was renamed. False if new list was not renamed, because user has not given any name.
 */
private boolean renameItem(){
  EditText edittext=(EditText)mDialog.findViewById(R.id.edittext);
  String s=edittext.getText().toString();
  if (s.equals("String_Node_Str")) {
    Toast.makeText(this,getString(R.string.please_enter_name),Toast.LENGTH_SHORT).show();
    return false;
  }
  String oldItemName=mCursorItems.getString(mStringItemsITEMNAME);
  String newItemName=s;
  long itemId=mCursorItems.getLong(mStringItemsITEMID);
  Cursor cursor=getContentResolver().query(Shopping.Items.CONTENT_URI,Shopping.Items.PROJECTION,Shopping.Items._ID + "String_Node_Str",new String[]{"String_Node_Str" + itemId},Shopping.Items.DEFAULT_SORT_ORDER);
  if (cursor != null && cursor.next()) {
    cursor.updateString(Shopping.Items.PROJECTION_NAME,newItemName);
    cursor.commitUpdates();
  }
 else {
    Log.e(TAG,"String_Node_Str");
  }
  mCursorItems.requery();
  String recipients=mCursorListFilter.getString(mStringListFilterSHARECONTACTS);
  if (!recipients.equals("String_Node_Str")) {
    String shareName=mCursorListFilter.getString(mStringListFilterSHARENAME);
    long status=mCursorItems.getLong(mStringItemsSTATUS);
    mGTalkSender.sendItemUpdate(recipients,shareName,oldItemName,newItemName,status,status);
  }
  return true;
}
Program: 187926
Project: 187926
Buggy source:
/** 
 * Delete item 
 */
void deleteItem(int position){
  mCursorItems.moveTo(position);
  mCursorItems.deleteRow();
  mCursorItems.requery();
}

Fixed version (ground truth):
/** 
 * Delete item 
 */
void deleteItem(int position){
  String itemName=mCursorItems.getString(mStringItemsITEMNAME);
  long oldstatus=mCursorItems.getLong(mStringItemsSTATUS);
  mCursorItems.moveTo(position);
  mCursorItems.deleteRow();
  mCursorItems.requery();
  String recipients=mCursorListFilter.getString(mStringListFilterSHARECONTACTS);
  if (!recipients.equals("String_Node_Str")) {
    String shareName=mCursorListFilter.getString(mStringListFilterSHARENAME);
    long newstatus=Shopping.Status.BOUGHT;
    Log.i(TAG,"String_Node_Str" + "String_Node_Str" + recipients + "String_Node_Str"+ shareName+ "String_Node_Str"+ newstatus);
    mGTalkSender.sendItemUpdate(recipients,shareName,itemName,itemName,oldstatus,newstatus);
  }
}
Program: 187929
Project: 187929
Buggy source:
public static void registerDateTimeAlert(ContentValues cv){
  String myDate=cv.getAsString(DateTime.TIME);
  String s[]=myDate.split("String_Node_Str");
  Log.d(_TAG,"String_Node_Str" + s[0] + "String_Node_Str"+ s[1]+ "String_Node_Str");
  long time=0;
  long myReoccurence=cv.getAsLong(DateTime.REOCCURENCE);
  Intent i=new Intent();
  Bundle b=new Bundle();
  b.putString(DateTime.TIME,myDate);
  b.putLong(DateTime.REOCCURENCE,myReoccurence);
  i.setAction(org.openintents.OpenIntents.DATE_TIME_ALERT_DISPATCH);
  try {
    time=Long.parseLong(s[1]);
  }
 catch (  NumberFormatException nfe) {
    Log.e(_TAG,"String_Node_Str" + myDate + "String_Node_Str");
    return;
  }
  if (myReoccurence == 0) {
    alarmManager.set(AlarmManager.RTC,time,i);
  }
 else {
    alarmManager.setRepeating(AlarmManager.RTC,time,myReoccurence,i);
  }
}

Fixed version (ground truth):
public static void registerDateTimeAlert(ContentValues cv){
  String myDate=cv.getAsString(DateTime.TIME);
  String s[]=myDate.split("String_Node_Str");
  Log.d(_TAG,"String_Node_Str" + s[0] + "String_Node_Str"+ s[1]+ "String_Node_Str");
  long time=0;
  long myReoccurence=cv.getAsLong(DateTime.REOCCURENCE);
  Intent i=new Intent();
  Bundle b=new Bundle();
  b.putString(DateTime.TIME,myDate);
  b.putLong(DateTime.REOCCURENCE,myReoccurence);
  i.setAction(org.openintents.OpenIntents.DATE_TIME_ALERT_DISPATCH);
  try {
    time=Long.parseLong(s[1]);
  }
 catch (  NumberFormatException nfe) {
    Log.e(_TAG,"String_Node_Str" + myDate + "String_Node_Str");
    return;
  }
  if (myReoccurence == 0) {
    alarmManager.set(AlarmManager.RTC,time,i);
    Log.d(_TAG,"String_Node_Str" + time + "String_Node_Str");
  }
 else {
    alarmManager.setRepeating(AlarmManager.RTC,time,myReoccurence,i);
    Log.d(_TAG,"String_Node_Str" + time + "String_Node_Str"+ myReoccurence+ "String_Node_Str");
  }
}
Program: 187931
Project: 187931
Buggy source:
public void bindCursor(final Cursor cursor){
  final String packageName=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  String name=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  mAlertinfoString="String_Node_Str";
  mIconDrawable=null;
  new Thread(){
    @Override public void run(){
      PackageManager pm=mContext.getPackageManager();
      try {
        ProviderInfo providerInfo=pm.resolveContentProvider(packageName,0);
        if (providerInfo != null) {
          mIconDrawable=providerInfo.loadIcon(pm);
        }
 else {
          mIconDrawable=pm.getApplicationIcon(packageName);
        }
      }
 catch (      Exception e) {
        Log.e("String_Node_Str","String_Node_Str",e);
        mIconDrawable=pm.getDefaultActivityIcon();
      }
      String data=cursor.getString(2);
      Uri uri=Uri.parse(data);
      Intent intent=new Intent(Intent.PICK_ACTION,uri);
      if (pm.resolveActivity(intent,0) == null) {
        intent.setAction(Intent.GET_CONTENT_ACTION);
        if (pm.resolveActivity(intent,0) == null) {
          mAlertinfoString="String_Node_Str";
        }
      }
      ;
      mHandler.post(updateViews);
    }
  }
.start();
  mName.setText(name);
  mPackageName.setText(packageName);
}

Fixed version (ground truth):
public void bindCursor(final Cursor cursor){
  final String packageName=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  String name=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  mAlertinfoString="String_Node_Str";
  mIconDrawable=null;
  new Thread(){
    @Override public void run(){
      PackageManager pm=mContext.getPackageManager();
      try {
        ProviderInfo providerInfo=pm.resolveContentProvider(packageName,0);
        if (providerInfo != null) {
          mIconDrawable=providerInfo.loadIcon(pm);
        }
 else {
          mIconDrawable=pm.getApplicationIcon(packageName);
        }
      }
 catch (      Exception e) {
        Log.e("String_Node_Str","String_Node_Str",e);
        mIconDrawable=pm.getDefaultActivityIcon();
      }
      String data=cursor.getString(2);
      Uri uri=Uri.parse(data);
      Intent intent=new Intent(Intent.PICK_ACTION,uri);
      mAlertinfoString="String_Node_Str";
      if (pm.resolveActivity(intent,0) == null) {
        intent.setAction(Intent.GET_CONTENT_ACTION);
        if (pm.resolveActivity(intent,0) == null) {
          mAlertinfoString="String_Node_Str";
        }
      }
      ;
      mHandler.post(updateViews);
    }
  }
.start();
  mName.setText(name);
  mPackageName.setText(packageName);
  mAlertInfo.setText(mAlertinfoString);
}
Program: 187932
Project: 187932
Buggy source:
@Override public void run(){
  PackageManager pm=mContext.getPackageManager();
  try {
    ProviderInfo providerInfo=pm.resolveContentProvider(packageName,0);
    if (providerInfo != null) {
      mIconDrawable=providerInfo.loadIcon(pm);
    }
 else {
      mIconDrawable=pm.getApplicationIcon(packageName);
    }
  }
 catch (  Exception e) {
    Log.e("String_Node_Str","String_Node_Str",e);
    mIconDrawable=pm.getDefaultActivityIcon();
  }
  String data=cursor.getString(2);
  Uri uri=Uri.parse(data);
  Intent intent=new Intent(Intent.PICK_ACTION,uri);
  if (pm.resolveActivity(intent,0) == null) {
    intent.setAction(Intent.GET_CONTENT_ACTION);
    if (pm.resolveActivity(intent,0) == null) {
      mAlertinfoString="String_Node_Str";
    }
  }
  ;
  mHandler.post(updateViews);
}

Fixed version (ground truth):
@Override public void run(){
  PackageManager pm=mContext.getPackageManager();
  try {
    ProviderInfo providerInfo=pm.resolveContentProvider(packageName,0);
    if (providerInfo != null) {
      mIconDrawable=providerInfo.loadIcon(pm);
    }
 else {
      mIconDrawable=pm.getApplicationIcon(packageName);
    }
  }
 catch (  Exception e) {
    Log.e("String_Node_Str","String_Node_Str",e);
    mIconDrawable=pm.getDefaultActivityIcon();
  }
  String data=cursor.getString(2);
  Uri uri=Uri.parse(data);
  Intent intent=new Intent(Intent.PICK_ACTION,uri);
  mAlertinfoString="String_Node_Str";
  if (pm.resolveActivity(intent,0) == null) {
    intent.setAction(Intent.GET_CONTENT_ACTION);
    if (pm.resolveActivity(intent,0) == null) {
      mAlertinfoString="String_Node_Str";
    }
  }
  ;
  mHandler.post(updateViews);
}
Program: 187933
Project: 187933
Buggy source:
public void onReceiveIntent(Context context,Intent intent){
  SharedPreferences settings=context.getSharedPreferences(NewsreaderService.PREFS_NAME,0);
  useWhileRoaming=settings.getBoolean(NewsreaderService.DO_ROAMING,false);
  debugMode=settings.getBoolean(NewsreaderService.DEBUG_MODE,false);
  Log.d(_TAG,"String_Node_Str" + useWhileRoaming);
  String action=intent.getAction();
  Log.d(_TAG,action);
  if (action == null) {
    Log.e(_TAG,"String_Node_Str");
    return;
  }
 else   if (android.content.Intent.SERVICE_STATE_CHANGED_ACTION.equals(action)) {
    Bundle b=intent.getExtras();
    isRoaming=b.getBoolean("String_Node_Str");
    Log.d(_TAG,"String_Node_Str" + b.getString("String_Node_Str") + "String_Node_Str");
    if (isRoaming && !useWhileRoaming) {
      Log.d(_TAG,"String_Node_Str");
      context.stopService(new Intent(context,NewsreaderService1.class));
      didStop=true;
    }
 else     if (!isRoaming && !useWhileRoaming && didStop) {
      didStop=false;
      Log.d(_TAG,"String_Node_Str");
      context.startService(new Intent(context,NewsreaderService1.class),null);
    }
  }
}

Fixed version (ground truth):
public void onReceiveIntent(Context context,Intent intent){
  SharedPreferences settings=context.getSharedPreferences(NewsreaderService.PREFS_NAME,0);
  useWhileRoaming=settings.getBoolean(NewsreaderService.DO_ROAMING,false);
  debugMode=settings.getBoolean(NewsreaderService.DEBUG_MODE,false);
  Log.d(_TAG,"String_Node_Str" + useWhileRoaming);
  String action=intent.getAction();
  Log.d(_TAG,action);
  if (action == null) {
    Log.e(_TAG,"String_Node_Str");
    return;
  }
 else   if (android.content.Intent.SERVICE_STATE_CHANGED_ACTION.equals(action)) {
    Bundle b=intent.getExtras();
    isRoaming=intent.getBooleanExtra("String_Node_Str",false);
    Log.d(_TAG,"String_Node_Str" + isRoaming + "String_Node_Str");
    Log.d(_TAG,"String_Node_Str" + didStop + "String_Node_Str");
    if (isRoaming && !useWhileRoaming) {
      Log.d(_TAG,"String_Node_Str");
      context.stopService(new Intent(context,NewsreaderService1.class));
      didStop=true;
    }
 else     if (!isRoaming && !useWhileRoaming && didStop) {
      didStop=false;
      Log.d(_TAG,"String_Node_Str");
      context.startService(new Intent(context,NewsreaderService1.class),null);
    }
  }
}
Program: 187935
Project: 187935
Buggy source:
public void onClick(View view){
  addNewsFeeds();
  Toast.makeText(InitView.this,R.string.init_done,Toast.LENGTH_SHORT).show();
}

Fixed version (ground truth):
public void onClick(View view){
  Intent intent=new Intent();
  intent.setAction("String_Node_Str");
  intent.addCategory(Intent.DEFAULT_CATEGORY);
  startActivity(intent);
}
Program: 187936
Project: 187936
Buggy source:
private void menuDelete(){
  boolean res=false;
  int pos=getSelectedItemPosition();
  mCursor.moveTo(pos);
  res=mCursor.deleteRow();
  Log.d(_TAG,"String_Node_Str" + pos + "String_Node_Str"+ res);
}

Fixed version (ground truth):
private void menuDelete(){
  boolean res=false;
  int pos=getSelectedItemPosition();
  if (pos > -1) {
    mCursor.moveTo(pos);
    res=mCursor.deleteRow();
    Log.d(_TAG,"String_Node_Str" + pos + "String_Node_Str"+ res);
  }
}
Program: 187937
Project: 187937
Buggy source:
private void menuMagnolia(){
  Bundle b=new Bundle();
  int pos=getSelectedItemPosition();
  mCursor.moveTo(pos);
  String strUri="String_Node_Str";
  String desc="String_Node_Str";
  if (feedType.equals(News.FEED_TYPE_RSS)) {
    strUri=mCursor.getString(mCursor.getColumnIndex(News.RSSFeedContents.ITEM_LINK));
    desc=mCursor.getString(mCursor.getColumnIndex(News.RSSFeedContents.ITEM_TITLE));
  }
 else   if (feedType.equals(News.FEED_TYPE_ATOM)) {
    strUri=mCursor.getString(mCursor.getColumnIndex(News.AtomFeedContents.ENTRY_LINK));
    desc=mCursor.getString(mCursor.getColumnIndex(News.AtomFeedContents.ENTRY_TITLE));
  }
  b.putString(MagnoliaTagging.URI,strUri);
  b.putString(MagnoliaTagging.DESCRIPTION,desc);
  Intent intent=new Intent();
  intent.setAction("String_Node_Str");
  intent.addCategory(Intent.DEFAULT_CATEGORY);
  intent.putExtras(b);
  startActivity(intent);
}

Fixed version (ground truth):
private void menuMagnolia(){
  Bundle b=new Bundle();
  int pos=getSelectedItemPosition();
  if (pos > -1) {
    mCursor.moveTo(pos);
    String strUri="String_Node_Str";
    String desc="String_Node_Str";
    if (feedType.equals(News.FEED_TYPE_RSS)) {
      strUri=mCursor.getString(mCursor.getColumnIndex(News.RSSFeedContents.ITEM_LINK));
      desc=mCursor.getString(mCursor.getColumnIndex(News.RSSFeedContents.ITEM_TITLE));
    }
 else     if (feedType.equals(News.FEED_TYPE_ATOM)) {
      strUri=mCursor.getString(mCursor.getColumnIndex(News.AtomFeedContents.ENTRY_LINK));
      desc=mCursor.getString(mCursor.getColumnIndex(News.AtomFeedContents.ENTRY_TITLE));
    }
    b.putString(MagnoliaTagging.URI,strUri);
    b.putString(MagnoliaTagging.DESCRIPTION,desc);
    Intent intent=new Intent();
    intent.setAction("String_Node_Str");
    intent.addCategory(Intent.DEFAULT_CATEGORY);
    intent.putExtras(b);
    startActivity(intent);
  }
}
Program: 187938
Project: 187938
Buggy source:
private void followItemLink(){
  int pos=getSelectedItemPosition();
  mCursor.moveTo(pos);
  Uri uri=null;
  if (feedType.equals(News.FEED_TYPE_RSS)) {
    String strUri=mCursor.getString(mCursor.getColumnIndex(News.RSSFeedContents.ITEM_LINK));
    uri=Uri.parse(strUri);
  }
 else   if (feedType.equals(News.FEED_TYPE_ATOM)) {
    String strUri=mCursor.getString(mCursor.getColumnIndex(News.AtomFeedContents.ENTRY_LINK));
    uri=Uri.parse(strUri);
  }
  Intent intent=new Intent(Intent.VIEW_ACTION,uri);
  startActivity(intent);
}

Fixed version (ground truth):
private void followItemLink(){
  int pos=getSelectedItemPosition();
  Log.d(_TAG,"String_Node_Str" + pos + "String_Node_Str");
  if (pos > -1) {
    mCursor.moveTo(pos);
    Uri uri=null;
    if (feedType.equals(News.FEED_TYPE_RSS)) {
      String strUri=mCursor.getString(mCursor.getColumnIndex(News.RSSFeedContents.ITEM_LINK));
      uri=Uri.parse(strUri);
    }
 else     if (feedType.equals(News.FEED_TYPE_ATOM)) {
      String strUri=mCursor.getString(mCursor.getColumnIndex(News.AtomFeedContents.ENTRY_LINK));
      uri=Uri.parse(strUri);
    }
    Intent intent=new Intent(Intent.VIEW_ACTION,uri);
    startActivity(intent);
  }
}
Program: 187939
Project: 187939
Buggy source:
@Override public boolean onCreateOptionsMenu(Menu menu){
  Log.v("String_Node_Str","String_Node_Str");
  android.view.SubMenu submenu;
  boolean result=super.onCreateOptionsMenu(menu);
  menu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_FOLLOW,"String_Node_Str");
  menu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_DELETE,"String_Node_Str");
  submenu=menu.addSubMenu(0,AFeedMessages.MENU_TAGS,"String_Node_Str");
  submenu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_TAG,"String_Node_Str",R.drawable.tagging_application001a);
  submenu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_MAGNOLIA,"String_Node_Str",R.drawable.tagging_magnolia_application001a);
  return result;
}

Fixed version (ground truth):
@Override public boolean onCreateOptionsMenu(Menu menu){
  Log.v("String_Node_Str","String_Node_Str");
  android.view.SubMenu submenu;
  boolean result=super.onCreateOptionsMenu(menu);
  menu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_FOLLOW,"String_Node_Str");
  menu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_DELETE,"String_Node_Str",R.drawable.shoppinglistdelete001b);
  submenu=menu.addSubMenu(0,AFeedMessages.MENU_TAGS,"String_Node_Str",R.drawable.tagging_application001a);
  submenu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_MAGNOLIA,"String_Node_Str",R.drawable.tagging_magnolia_application001a);
  return result;
}
Program: 187942
Project: 187942
Buggy source:
public void saveBookmark(){
  Log.d(_TAG,"String_Node_Str");
  boolean remoteResult=false;
  String bookmarkURL=mCURL.getText().toString();
  String strOtags=mOutboundTags.getText().toString();
  String description=mDescription.getText().toString();
  boolean shared=mShared.isChecked();
  String[] oTags=strOtags.split("String_Node_Str");
  Log.d(_TAG,"String_Node_Str" + oTags.toString() + "String_Node_Str");
  if (!bookmarkURL.startsWith("String_Node_Str")) {
    Log.d(_TAG,"String_Node_Str");
    bookmarkURL="String_Node_Str" + bookmarkURL;
  }
  DeliciousApiHelper dah=new DeliciousApiHelper(DeliciousApiHelper.MAGNOLIA_API,mScreenName,mPassWd);
  mProgress.setIndeterminate(true);
  mProgress.setVisibility(ProgressBar.VISIBLE);
  try {
    TaggThread t=new TaggThread(dah,bookmarkURL,description,oTags,shared);
    t.run();
    t.join();
  }
 catch (  java.lang.InterruptedException ioe2) {
    Log.e(_TAG,"String_Node_Str" + ioe2.getMessage() + "String_Node_Str");
  }
  if (remoteResult) {
    int otl=oTags.length;
    for (int i=0; i < otl; i++) {
      insertTag(oTags[i],bookmarkURL);
    }
    setResult(Activity.RESULT_OK);
    finish();
  }
  mProgress.setIndeterminate(false);
  mProgress.setVisibility(ProgressBar.GONE);
  Log.d(_TAG,"String_Node_Str");
}

Fixed version (ground truth):
public void saveBookmark(){
  Log.d(_TAG,"String_Node_Str");
  boolean remoteResult=false;
  String bookmarkURL=mCURL.getText().toString();
  String strOtags=mOutboundTags.getText().toString();
  String description=mDescription.getText().toString();
  boolean shared=mShared.isChecked();
  String[] oTags=strOtags.split("String_Node_Str");
  Log.d(_TAG,"String_Node_Str" + oTags.toString() + "String_Node_Str");
  if (!bookmarkURL.startsWith("String_Node_Str")) {
    Log.d(_TAG,"String_Node_Str");
    bookmarkURL="String_Node_Str" + bookmarkURL;
  }
  DeliciousApiHelper dah=new DeliciousApiHelper(DeliciousApiHelper.MAGNOLIA_API,mScreenName,mPassWd);
  try {
    TaggThread t=new TaggThread(dah,bookmarkURL,description,oTags,shared);
    t.run();
    t.join();
    remoteResult=t.getResult();
  }
 catch (  java.lang.InterruptedException ioe2) {
    Log.e(_TAG,"String_Node_Str" + ioe2.getMessage() + "String_Node_Str");
  }
  if (remoteResult) {
    int otl=oTags.length;
    for (int i=0; i < otl; i++) {
      insertTag(oTags[i],bookmarkURL);
    }
    setResult(Activity.RESULT_OK);
    finish();
  }
  Log.d(_TAG,"String_Node_Str");
}
Program: 187943
Project: 187943
Buggy source:
public TaggThread(DeliciousApiHelper dah,String u,String d,String[] t,boolean s){
  this.dah=dah;
  this.bmUri=u;
  this.desc=d;
  this.tags=t;
  this.shared=s;
}

Fixed version (ground truth):
public TaggThread(DeliciousApiHelper dah,String u,String d,String[] t,boolean s,ProgressDialog pg){
  this.dah=dah;
  this.bmUri=u;
  this.desc=d;
  this.tags=t;
  this.shared=s;
  this.callback=pg;
}
Program: 187944
Project: 187944
Buggy source:
public void saveBookmark(){
  Log.d(_TAG,"String_Node_Str");
  boolean remoteResult=false;
  String bookmarkURL=mCURL.getText().toString();
  String strOtags=mOutboundTags.getText().toString();
  String description=mDescription.getText().toString();
  boolean shared=mShared.isChecked();
  String[] oTags=strOtags.split("String_Node_Str");
  Log.d(_TAG,"String_Node_Str" + oTags.toString() + "String_Node_Str");
  if (!bookmarkURL.startsWith("String_Node_Str")) {
    Log.d(_TAG,"String_Node_Str");
    bookmarkURL="String_Node_Str" + bookmarkURL;
  }
  DeliciousApiHelper dah=new DeliciousApiHelper(DeliciousApiHelper.MAGNOLIA_API,mScreenName,mPassWd);
  mProgress.setIndeterminate(true);
  mProgress.setVisibility(ProgressBar.VISIBLE);
  try {
    remoteResult=dah.addPost(bookmarkURL,description,null,oTags,shared);
  }
 catch (  java.io.IOException ioe) {
    Log.e(_TAG,"String_Node_Str" + ioe.getMessage() + "String_Node_Str");
  }
  if (remoteResult) {
    int otl=oTags.length;
    for (int i=0; i < otl; i++) {
      insertTag(oTags[i],bookmarkURL);
    }
    setResult(Activity.RESULT_OK);
    finish();
  }
  mProgress.setIndeterminate(false);
  mProgress.setVisibility(ProgressBar.GONE);
  Log.d(_TAG,"String_Node_Str");
}

Fixed version (ground truth):
public void saveBookmark(){
  Log.d(_TAG,"String_Node_Str");
  boolean remoteResult=false;
  String bookmarkURL=mCURL.getText().toString();
  String strOtags=mOutboundTags.getText().toString();
  String description=mDescription.getText().toString();
  boolean shared=mShared.isChecked();
  String[] oTags=strOtags.split("String_Node_Str");
  Log.d(_TAG,"String_Node_Str" + oTags.toString() + "String_Node_Str");
  if (!bookmarkURL.startsWith("String_Node_Str")) {
    Log.d(_TAG,"String_Node_Str");
    bookmarkURL="String_Node_Str" + bookmarkURL;
  }
  DeliciousApiHelper dah=new DeliciousApiHelper(DeliciousApiHelper.MAGNOLIA_API,mScreenName,mPassWd);
  mProgress.setIndeterminate(true);
  mProgress.setVisibility(ProgressBar.VISIBLE);
  try {
    TaggThread t=new TaggThread(dah,bookmarkURL,description,oTags,shared);
    t.run();
    t.join();
  }
 catch (  java.lang.InterruptedException ioe2) {
    Log.e(_TAG,"String_Node_Str" + ioe2.getMessage() + "String_Node_Str");
  }
  if (remoteResult) {
    int otl=oTags.length;
    for (int i=0; i < otl; i++) {
      insertTag(oTags[i],bookmarkURL);
    }
    setResult(Activity.RESULT_OK);
    finish();
  }
  mProgress.setIndeterminate(false);
  mProgress.setVisibility(ProgressBar.GONE);
  Log.d(_TAG,"String_Node_Str");
}
Program: 187945
Project: 187945
Buggy source:
private void fillDataTags(){
  Log.d(_TAG,"String_Node_Str");
  String filter=null;
  String[] filterArray=null;
  if (mFilter != null) {
    filter="String_Node_Str";
    filterArray=new String[]{mFilter};
  }
  Cursor c=getContentResolver().query(Tags.CONTENT_URI,new String[]{Tags._ID,Tags.TAG_ID,Tags.CONTENT_ID,Tags.URI_1,Tags.URI_2},filter,filterArray,Tags.DEFAULT_SORT_ORDER);
  startManagingCursor(c);
  Log.d(_TAG,"String_Node_Str" + c.count() + "String_Node_Str");
  if (c == null) {
    Log.e(_TAG,"String_Node_Str");
    mTags.setAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1,new String[]{"String_Node_Str"}));
    return;
  }
  ListAdapter adapter=new SimpleCursorAdapter(this,R.layout.tag_row,c,new String[]{Tags.URI_1},new int[]{R.id.tag_uri_1});
  Log.d(_TAG,"String_Node_Str" + adapter.toString() + "String_Node_Str");
  mTags.setAdapter(adapter);
}

Fixed version (ground truth):
private void fillDataTags(){
  Log.d(_TAG,"String_Node_Str");
  String filter=null;
  String[] filterArray=null;
  if (mFilter != null) {
    filter="String_Node_Str";
    filterArray=new String[]{mFilter};
  }
  Cursor c=getContentResolver().query(Tags.CONTENT_URI,new String[]{Tags._ID,Tags.TAG_ID,Tags.CONTENT_ID,Tags.URI_1,Tags.URI_2},filter,filterArray,Tags.DEFAULT_SORT_ORDER);
  startManagingCursor(c);
  Log.d(_TAG,"String_Node_Str" + c.count() + "String_Node_Str");
  if (c == null) {
    Log.e(_TAG,"String_Node_Str");
    mTags.setAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1,new String[]{"String_Node_Str"}));
    return;
  }
  ListAdapter adapter=new SimpleCursorAdapter(this,R.layout.magnolia_tag_row,c,new String[]{Tags.URI_1},new int[]{R.id.tag_uri_1});
  Log.d(_TAG,"String_Node_Str" + adapter.toString() + "String_Node_Str");
  mTags.setAdapter(adapter);
}
Program: 187946
Project: 187946
Buggy source:
private void saveDataSet(){
  Log.d(_TAG,"String_Node_Str");
  Log.v(_TAG,"String_Node_Str" + mCursor.requery());
  Log.v(_TAG,"String_Node_Str" + mCursor.next());
  mCursor.updateString(cond1Row,mCond1.getText().toString());
  mCursor.updateString(cond2Row,mCond2.getText().toString());
  mCursor.updateString(intentRow,mIntent.getText().toString());
  mCursor.updateString(intentCatRow,mIntentCat.getText().toString());
  mCursor.updateString(intentUriRow,mIntentUri.getText().toString());
  mCursor.updateString(typeRow,((String)mType.getSelectedItem()));
  if (mActive.isChecked()) {
    mCursor.updateInt(activeRow,1);
  }
 else {
    mCursor.updateInt(activeRow,0);
  }
  if (mOnBoot.isChecked()) {
    mCursor.updateInt(onBootRow,1);
  }
 else {
    mCursor.updateInt(onBootRow,0);
  }
  mCursor.commitUpdates();
  if (Alert.TYPE_LOCATION.equals(mType.getSelectedItem())) {
    ContentValues cv=new ContentValues();
    cv.put(Location.POSITION,mCond1.getText().toString());
    cv.put(Location.DISTANCE,mCond2.getText().toString());
    Alert.registerLocationAlert(cv);
  }
}

Fixed version (ground truth):
private void saveDataSet(){
  Log.d(_TAG,"String_Node_Str");
  Log.v(_TAG,"String_Node_Str" + mCursor.first());
  CharSequence c=null;
  String s=new String();
  c=mCond1.getText();
  if (TextUtils.isEmpty(c)) {
    s="String_Node_Str";
  }
 else {
    s=c.toString();
  }
  mCursor.updateString(cond1Row,s);
  c=mCond2.getText();
  if (TextUtils.isEmpty(c)) {
    s="String_Node_Str";
  }
 else {
    s=c.toString();
  }
  Log.d(_TAG,"String_Node_Str" + s + "String_Node_Str");
  try {
    mCursor.updateString(mCursor.getColumnIndex(Alert.Generic.CONDITION2),s);
  }
 catch (  Exception ex) {
    Log.e(_TAG,"String_Node_Str");
  }
  c=mIntent.getText();
  if (TextUtils.isEmpty(c)) {
    s="String_Node_Str";
  }
 else {
    s=c.toString();
  }
  mCursor.updateString(intentRow,s);
  c=mIntentCat.getText();
  if (TextUtils.isEmpty(c)) {
    s="String_Node_Str";
  }
 else {
    s=c.toString();
  }
  mCursor.updateString(intentCatRow,s);
  c=mIntentUri.getText();
  if (TextUtils.isEmpty(c)) {
    s="String_Node_Str";
  }
 else {
    s=c.toString();
  }
  mCursor.updateString(intentUriRow,s);
  mCursor.updateString(typeRow,((String)mType.getSelectedItem()));
  if (mActive.isChecked()) {
    mCursor.updateInt(activeRow,1);
  }
 else {
    mCursor.updateInt(activeRow,0);
  }
  if (mOnBoot.isChecked()) {
    mCursor.updateInt(onBootRow,1);
  }
 else {
    mCursor.updateInt(onBootRow,0);
  }
  mCursor.commitUpdates();
  if (Alert.TYPE_LOCATION.equals(mType.getSelectedItem())) {
    ContentValues cv=new ContentValues();
    cv.put(Location.POSITION,mCond1.getText().toString());
    cv.put(Location.DISTANCE,mCond2.getText().toString());
    Alert.registerLocationAlert(cv);
  }
}
Program: 187947
Project: 187947
Buggy source:
public void onPause(){
  super.onPause();
  if (mState == STATE_CREATE) {
    createDataSet();
  }
 else   if (mState == STATE_EDIT) {
    saveDataSet();
  }
  if (mCursor != null) {
    mCursor.close();
  }
}

Fixed version (ground truth):
public void onPause(){
  super.onPause();
  Log.d(_TAG,"String_Node_Str" + mState + "String_Node_Str");
  if (mState == STATE_CREATE) {
    createDataSet();
  }
 else   if (mState == STATE_EDIT) {
    saveDataSet();
  }
  if (mCursor != null) {
    mCursor.close();
  }
}
Program: 187948
Project: 187948
Buggy source:
@Override public boolean onOptionsItemSelected(Item item){
  super.onOptionsItemSelected(item);
  boolean result=true;
  Intent intent;
switch (item.getId()) {
case MENU_PICK_LOC:
    intent=new Intent(Intent.PICK_ACTION,Locations.CONTENT_URI);
  startSubActivity(intent,REQUEST_PICK_LOC);
break;
case MENU_PICK_ACTION:
intent=new Intent(Intent.PICK_ACTION,Intents.CONTENT_URI);
intent.putExtra(Intents.EXTRA_ACTION_LIST,Intent.VIEW_ACTION);
startSubActivity(intent,REQUEST_PICK_ACTION);
break;
case MENU_PICK_DATE_TIME:
break;
default :
result=false;
}
return result;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(Item item){
  super.onOptionsItemSelected(item);
  boolean result=true;
  Intent intent;
switch (item.getId()) {
case MENU_PICK_LOC:
    intent=new Intent(Intent.PICK_ACTION,Locations.CONTENT_URI);
  if (mState == STATE_CREATE) {
    mState=STATE_SUB_CREATE;
  }
 else   if (mState == STATE_EDIT) {
    mState=STATE_SUB_EDIT;
  }
startSubActivity(intent,REQUEST_PICK_LOC);
break;
case MENU_PICK_ACTION:
intent=new Intent(Intent.PICK_ACTION,Intents.CONTENT_URI);
intent.putExtra(Intents.EXTRA_ACTION_LIST,Intent.VIEW_ACTION);
if (mState == STATE_CREATE) {
mState=STATE_SUB_CREATE;
}
 else if (mState == STATE_EDIT) {
mState=STATE_SUB_EDIT;
}
startSubActivity(intent,REQUEST_PICK_ACTION);
break;
case MENU_PICK_DATE_TIME:
break;
default :
result=false;
}
return result;
}
Program: 187949
Project: 187949
Buggy source:
public MessageListAdapter(Cursor c,Context context,boolean autoRequery,String feedType){
  super(c,context,autoRequery);
  initBoolTable(c.count());
  this.feedType=feedType;
}

Fixed version (ground truth):
public MessageListAdapter(Cursor c,Context context,boolean autoRequery,String feedType){
  super(c,context,autoRequery);
  registerDataSetObserver(new MyObserver(this));
  initBoolTable(c.count());
  this.feedType=feedType;
}
Program: 187950
Project: 187950
Buggy source:
private void menuMagnolia(){
  Bundle b=new Bundle();
  int pos=getSelectedItemPosition();
  mCursor.moveTo(pos);
  String strUri="String_Node_Str";
  String desc="String_Node_Str";
  if (feedType.equals(News.FEED_TYPE_RSS)) {
    strUri=mCursor.getString(mCursor.getColumnIndex(News.RSSFeedContents.ITEM_LINK));
    desc=mCursor.getString(mCursor.getColumnIndex(News.RSSFeedContents.ITEM_TITLE));
  }
 else   if (feedType.equals(News.FEED_TYPE_ATOM)) {
    strUri=mCursor.getString(mCursor.getColumnIndex(News.AtomFeedContents.ENTRY_LINK));
    desc=mCursor.getString(mCursor.getColumnIndex(News.AtomFeedContents.ENTRY_TITLE));
  }
}

Fixed version (ground truth):
private void menuMagnolia(){
  Bundle b=new Bundle();
  int pos=getSelectedItemPosition();
  mCursor.moveTo(pos);
  String strUri="String_Node_Str";
  String desc="String_Node_Str";
  if (feedType.equals(News.FEED_TYPE_RSS)) {
    strUri=mCursor.getString(mCursor.getColumnIndex(News.RSSFeedContents.ITEM_LINK));
    desc=mCursor.getString(mCursor.getColumnIndex(News.RSSFeedContents.ITEM_TITLE));
  }
 else   if (feedType.equals(News.FEED_TYPE_ATOM)) {
    strUri=mCursor.getString(mCursor.getColumnIndex(News.AtomFeedContents.ENTRY_LINK));
    desc=mCursor.getString(mCursor.getColumnIndex(News.AtomFeedContents.ENTRY_TITLE));
  }
  b.putString(org.openintents.tags.MagnoliaTagging.URI,strUri);
  b.putString(org.openintents.tags.MagnoliaTagging.DESCRIPTION,desc);
  Intent intent=new Intent();
  intent.setAction("String_Node_Str");
  intent.addCategory(Intent.DEFAULT_CATEGORY);
  intent.putExtras(b);
  startActivity(intent);
}
Program: 187951
Project: 187951
Buggy source:
@Override public boolean onCreateOptionsMenu(Menu menu){
  Log.v("String_Node_Str","String_Node_Str");
  android.view.SubMenu submenu;
  boolean result=super.onCreateOptionsMenu(menu);
  menu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_FOLLOW,"String_Node_Str");
  menu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_DELETE,"String_Node_Str");
  submenu=menu.addSubMenu(0,AFeedMessages.MENU_TAGS,"String_Node_Str");
  submenu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_TAG,"String_Node_Str");
  submenu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_MAGNOLIA,"String_Node_Str");
  return result;
}

Fixed version (ground truth):
@Override public boolean onCreateOptionsMenu(Menu menu){
  Log.v("String_Node_Str","String_Node_Str");
  android.view.SubMenu submenu;
  boolean result=super.onCreateOptionsMenu(menu);
  menu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_FOLLOW,"String_Node_Str");
  menu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_DELETE,"String_Node_Str");
  submenu=menu.addSubMenu(0,AFeedMessages.MENU_TAGS,"String_Node_Str");
  submenu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_TAG,"String_Node_Str",R.drawable.tagging_application001a);
  submenu.add(0,AFeedMessages.SUBMENU_CHANNELITEM_MAGNOLIA,"String_Node_Str",R.drawable.tagging_magnolia_application001a);
  return result;
}
Program: 187952
Project: 187952
Buggy source:
@Override public void onCreate(Bundle icicle){
  Log.v(_TAG,"String_Node_Str");
  try {
    super.onCreate(icicle);
    Log.v(_TAG,Integer.toString(R.layout.newsreader));
    try {
      News.mContentResolver=getContentResolver();
      mRSSCursor=managedQuery(News.RSSFeeds.CONTENT_URI,RSS_PROJECTION,null,null);
      startManagingCursor(mRSSCursor);
      Log.d(_TAG,"String_Node_Str" + mRSSCursor);
      Log.d(_TAG,"String_Node_Str" + mRSSCursor.count() + "String_Node_Str");
    }
 catch (    Exception x) {
      Log.e(_TAG,"String_Node_Str" + x.getMessage() + "String_Node_Str");
    }
    setContentView(R.layout.newsreader);
    mChannelsView=(ListView)findViewById(R.id.newsreader_listitems);
    mChannelsView.setOnItemClickListener(new OnItemClickListener(){
      public void onItemClick(      AdapterView parent,      View v,      int position,      long id){
        parent.setSelection(position);
        Log.d("String_Node_Str","String_Node_Str");
        Newsreader.this.openChannel();
      }
    }
);
    updateChannelsList();
  }
 catch (  Exception e) {
    Log.e(_TAG,"String_Node_Str" + e.getMessage() + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle icicle){
  this.setTitle("String_Node_Str");
  try {
    super.onCreate(icicle);
    Log.v(_TAG,Integer.toString(R.layout.newsreader));
    try {
      News.mContentResolver=getContentResolver();
      mRSSCursor=managedQuery(News.RSSFeeds.CONTENT_URI,RSS_PROJECTION,null,null);
      startManagingCursor(mRSSCursor);
      Log.d(_TAG,"String_Node_Str" + mRSSCursor);
      Log.d(_TAG,"String_Node_Str" + mRSSCursor.count() + "String_Node_Str");
    }
 catch (    Exception x) {
      Log.e(_TAG,"String_Node_Str" + x.getMessage() + "String_Node_Str");
    }
    setContentView(R.layout.newsreader);
    mChannelsView=(ListView)findViewById(R.id.newsreader_listitems);
    mChannelsView.setOnItemClickListener(new OnItemClickListener(){
      public void onItemClick(      AdapterView parent,      View v,      int position,      long id){
        parent.setSelection(position);
        Log.d("String_Node_Str","String_Node_Str");
        Newsreader.this.openChannel();
      }
    }
);
    updateChannelsList();
  }
 catch (  Exception e) {
    Log.e(_TAG,"String_Node_Str" + e.getMessage() + "String_Node_Str");
  }
}
Program: 187953
Project: 187953
Buggy source:
/** 
 * Raises the data changed event, notifying observers that the data has changed.
 */
public void notifyDataSetChanged(){
  if (modified) {
    dataChangedEvent.raiseEvent(this,this);
  }
  modified=false;
}

Fixed version (ground truth):
/** 
 * Raises the data changed event, notifying observers that the data has changed, only if no transaction is currently being run.
 */
public void notifyDataSetChanged(){
  if (modified && !runningTransaction) {
    dataChangedEvent.raiseEvent(this,this);
  }
  modified=false;
}
Program: 187954
Project: 187954
Buggy source:
/** 
 * Ends the current transaction. This will raise the data changed event if any modifications have been made.
 * @see ObservableListAdapter#beginTransaction()
 * @throws IllegalStateException if no transaction is currently running.
 */
public void endTransaction(){
  if (runningTransaction) {
    runningTransaction=false;
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Ends the current transaction. This will raise the data changed event if any modifications have been made.
 * @see ObservableListAdapter#beginTransaction()
 * @throws IllegalStateException if no transaction is currently running.
 */
public void endTransaction(){
  if (runningTransaction) {
    runningTransaction=false;
    notifyDataSetChanged();
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 187955
Project: 187955
Buggy source:
/** 
 * Parse double value
 * @param value  String representation
 * @return         Raw representation, -1 if not a number
 */
public static double parseDouble(String value){
  try {
    return Double.parseDouble(value);
  }
 catch (  Throwable err) {
    return -1.0;
  }
}

Fixed version (ground truth):
/** 
 * Parse double value
 * @param value         String representation
 * @param defaultValue  Default value that will be used if that string starts with a ‘y’ or ‘Y’
 * @return                Raw representation, -1 if not a number
 */
public static double parseDouble(String value,double defaultValue){
  if (value.startsWith("String_Node_Str") || value.startsWith("String_Node_Str"))   return defaultValue;
  try {
    return Double.parseDouble(value);
  }
 catch (  Throwable err) {
    return -1.0;
  }
}
Program: 187957
Project: 187957
Buggy source:
/** 
 * Parse integer value
 * @param value  String representation
 * @return         Raw representation, -1 if not an integer
 */
public static int parseInteger(String value){
  try {
    return Integer.parseInt(value);
  }
 catch (  Throwable err) {
    return -1;
  }
}

Fixed version (ground truth):
/** 
 * Parse integer value
 * @param value         String representation
 * @param defaultValue  Default value that will be used if that string starts with a ‘y’ or ‘Y’
 * @return                Raw representation, -1 if not an integer
 */
public static int parseInteger(String value,int defaultValue){
  if (value.startsWith("String_Node_Str") || value.startsWith("String_Node_Str"))   return defaultValue;
  try {
    return Integer.parseInt(value);
  }
 catch (  Throwable err) {
    return -1;
  }
}
Program: 187962
Project: 187962
Buggy source:
/** 
 * Parse palette
 * @param value  String representation, without ESC, ] or P
 * @return         Raw representation
 */
protected static Color[] parsePalette(String value){
  String defvalue="String_Node_Str" + "String_Node_Str";
  Color[] palette=new Color[16];
  for (int ptr=0, n=defvalue.length(); ptr < n; ptr+=7) {
    int index=Integer.parseInt(defvalue.substring(ptr + 0,1),16);
    int red=Integer.parseInt(defvalue.substring(ptr + 1,2),16);
    int green=Integer.parseInt(defvalue.substring(ptr + 3,2),16);
    int blue=Integer.parseInt(defvalue.substring(ptr + 5,2),16);
    palette[index]=new Color(red,green,blue);
  }
  for (int ptr=0, n=value.length(); ptr < n; ptr+=7) {
    int index=Integer.parseInt(value.substring(ptr + 0,1),16);
    int red=Integer.parseInt(value.substring(ptr + 1,2),16);
    int green=Integer.parseInt(value.substring(ptr + 3,2),16);
    int blue=Integer.parseInt(value.substring(ptr + 5,2),16);
    palette[index]=new Color(red,green,blue);
  }
  return palette;
}

Fixed version (ground truth):
/** 
 * Parse palette
 * @param value  String representation, without ESC, ] or P
 * @return         Raw representation
 */
protected static Color[] parsePalette(String value){
  String defvalue="String_Node_Str" + "String_Node_Str";
  Color[] palette=new Color[16];
  for (int ptr=0, n=defvalue.length(); ptr < n; ptr+=7) {
    int index=Integer.parseInt(defvalue.substring(ptr + 0,ptr + 1),16);
    int red=Integer.parseInt(defvalue.substring(ptr + 1,ptr + 3),16);
    int green=Integer.parseInt(defvalue.substring(ptr + 3,ptr + 5),16);
    int blue=Integer.parseInt(defvalue.substring(ptr + 5,ptr + 7),16);
    palette[index]=new Color(red,green,blue);
  }
  for (int ptr=0, n=value.length(); ptr < n; ptr+=7) {
    int index=Integer.parseInt(value.substring(ptr + 0,ptr + 1),16);
    int red=Integer.parseInt(value.substring(ptr + 1,ptr + 3),16);
    int green=Integer.parseInt(value.substring(ptr + 3,ptr + 5),16);
    int blue=Integer.parseInt(value.substring(ptr + 5,ptr + 7),16);
    palette[index]=new Color(red,green,blue);
  }
  return palette;
}