nus-yam/ex-repair huggingface dataset:
Program: 45631
Project: 45631
Buggy source:
public void onClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return;
  }
  int index=mRollo.mState.selectedIconIndex;
  if (mRollo.checkClickOK() && index >= 0 && index < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(index);
    mLauncher.startActivitySafely(app.intent);
  }
}

Fixed version (ground truth):
public void onClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return;
  }
  if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex && mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(mCurrentIconIndex);
    mLauncher.startActivitySafely(app.intent);
  }
}
Program: 45633
Project: 45633
Buggy source:
void selectIcon(int index){
  int iconCount=mAllAppsList.size();
  if (index < 0 || index >= iconCount) {
    mState.selectedIconIndex=-1;
    return;
  }
 else {
    mState.selectedIconIndex=index;
    Bitmap selectionBitmap=mSelectionBitmap;
    Utilities.drawSelectedAllAppsBitmap(mSelectionCanvas,selectionBitmap.getWidth(),selectionBitmap.getHeight(),mAllAppsList.get(index).iconBitmap);
    mSelectedIcon=Allocation.createFromBitmap(mRS,selectionBitmap,Element.RGBA_8888(mRS),false);
    mSelectedIcon.uploadToTexture(0);
    mState.selectedIconTexture=mSelectedIcon.getID();
  }
}

Fixed version (ground truth):
void selectIcon(int index){
  if (index < 0) {
    mState.selectedIconIndex=-1;
  }
 else {
    mState.selectedIconIndex=index;
    Bitmap selectionBitmap=mSelectionBitmap;
    Utilities.drawSelectedAllAppsBitmap(mSelectionCanvas,selectionBitmap.getWidth(),selectionBitmap.getHeight(),mAllAppsList.get(index).iconBitmap);
    mSelectedIcon=Allocation.createFromBitmap(mRS,selectionBitmap,Element.RGBA_8888(mRS),false);
    mSelectedIcon.uploadToTexture(0);
    mState.selectedIconTexture=mSelectedIcon.getID();
  }
}
Program: 45634
Project: 45634
Buggy source:
public boolean onLongClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return true;
  }
  int index=mRollo.mState.selectedIconIndex;
  if (mRollo.checkClickOK() && index >= 0 && index < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(index);
    int screenX=mMotionDownRawX - (mDefines.ICON_WIDTH_PX / 2);
    int screenY=mMotionDownRawY - mDefines.ICON_HEIGHT_PX;
    int left=(mDefines.ICON_TEXTURE_WIDTH_PX - mDefines.ICON_WIDTH_PX) / 2;
    int top=(mDefines.ICON_TEXTURE_HEIGHT_PX - mDefines.ICON_HEIGHT_PX) / 2;
    mDragController.startDrag(app.iconBitmap,screenX,screenY,left,top,mDefines.ICON_WIDTH_PX,mDefines.ICON_HEIGHT_PX,this,app,DragController.DRAG_ACTION_COPY);
    mLauncher.closeAllApps(true);
  }
  return true;
}

Fixed version (ground truth):
public boolean onLongClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return true;
  }
  if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex && mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(mCurrentIconIndex);
    int screenX=mMotionDownRawX - (mDefines.ICON_WIDTH_PX / 2);
    int screenY=mMotionDownRawY - mDefines.ICON_HEIGHT_PX;
    int left=(mDefines.ICON_TEXTURE_WIDTH_PX - mDefines.ICON_WIDTH_PX) / 2;
    int top=(mDefines.ICON_TEXTURE_HEIGHT_PX - mDefines.ICON_HEIGHT_PX) / 2;
    mDragController.startDrag(app.iconBitmap,screenX,screenY,left,top,mDefines.ICON_WIDTH_PX,mDefines.ICON_HEIGHT_PX,this,app,DragController.DRAG_ACTION_COPY);
    mLauncher.closeAllApps(true);
  }
  return true;
}
Program: 45635
Project: 45635
Buggy source:
public void onClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return;
  }
  int index=mRollo.mState.selectedIconIndex;
  if (mRollo.checkClickOK() && index >= 0 && index < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(index);
    mLauncher.startActivitySafely(app.intent);
  }
}

Fixed version (ground truth):
public void onClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return;
  }
  if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex && mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(mCurrentIconIndex);
    mLauncher.startActivitySafely(app.intent);
  }
}
Program: 45637
Project: 45637
Buggy source:
void selectIcon(int index){
  int iconCount=mAllAppsList.size();
  if (index < 0 || index >= iconCount) {
    mState.selectedIconIndex=-1;
    return;
  }
 else {
    mState.selectedIconIndex=index;
    Bitmap selectionBitmap=mSelectionBitmap;
    Utilities.drawSelectedAllAppsBitmap(mSelectionCanvas,selectionBitmap.getWidth(),selectionBitmap.getHeight(),mAllAppsList.get(index).iconBitmap);
    mSelectedIcon=Allocation.createFromBitmap(mRS,selectionBitmap,Element.RGBA_8888(mRS),false);
    mSelectedIcon.uploadToTexture(0);
    mState.selectedIconTexture=mSelectedIcon.getID();
  }
}

Fixed version (ground truth):
void selectIcon(int index){
  if (index < 0) {
    mState.selectedIconIndex=-1;
  }
 else {
    mState.selectedIconIndex=index;
    Bitmap selectionBitmap=mSelectionBitmap;
    Utilities.drawSelectedAllAppsBitmap(mSelectionCanvas,selectionBitmap.getWidth(),selectionBitmap.getHeight(),mAllAppsList.get(index).iconBitmap);
    mSelectedIcon=Allocation.createFromBitmap(mRS,selectionBitmap,Element.RGBA_8888(mRS),false);
    mSelectedIcon.uploadToTexture(0);
    mState.selectedIconTexture=mSelectedIcon.getID();
  }
}
Program: 45638
Project: 45638
Buggy source:
public boolean onLongClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return true;
  }
  int index=mRollo.mState.selectedIconIndex;
  if (mRollo.checkClickOK() && index >= 0 && index < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(index);
    int screenX=mMotionDownRawX - (mDefines.ICON_WIDTH_PX / 2);
    int screenY=mMotionDownRawY - mDefines.ICON_HEIGHT_PX;
    int left=(mDefines.ICON_TEXTURE_WIDTH_PX - mDefines.ICON_WIDTH_PX) / 2;
    int top=(mDefines.ICON_TEXTURE_HEIGHT_PX - mDefines.ICON_HEIGHT_PX) / 2;
    mDragController.startDrag(app.iconBitmap,screenX,screenY,left,top,mDefines.ICON_WIDTH_PX,mDefines.ICON_HEIGHT_PX,this,app,DragController.DRAG_ACTION_COPY);
    mLauncher.closeAllApps(true);
  }
  return true;
}

Fixed version (ground truth):
public boolean onLongClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return true;
  }
  if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex && mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(mCurrentIconIndex);
    int screenX=mMotionDownRawX - (mDefines.ICON_WIDTH_PX / 2);
    int screenY=mMotionDownRawY - mDefines.ICON_HEIGHT_PX;
    int left=(mDefines.ICON_TEXTURE_WIDTH_PX - mDefines.ICON_WIDTH_PX) / 2;
    int top=(mDefines.ICON_TEXTURE_HEIGHT_PX - mDefines.ICON_HEIGHT_PX) / 2;
    mDragController.startDrag(app.iconBitmap,screenX,screenY,left,top,mDefines.ICON_WIDTH_PX,mDefines.ICON_HEIGHT_PX,this,app,DragController.DRAG_ACTION_COPY);
    mLauncher.closeAllApps(true);
  }
  return true;
}
Program: 45639
Project: 45639
Buggy source:
public void onClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return;
  }
  int index=mRollo.mState.selectedIconIndex;
  if (mRollo.checkClickOK() && index >= 0 && index < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(index);
    mLauncher.startActivitySafely(app.intent);
  }
}

Fixed version (ground truth):
public void onClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return;
  }
  if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex && mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(mCurrentIconIndex);
    mLauncher.startActivitySafely(app.intent);
  }
}
Program: 45641
Project: 45641
Buggy source:
void selectIcon(int index){
  int iconCount=mAllAppsList.size();
  if (index < 0 || index >= iconCount) {
    mState.selectedIconIndex=-1;
    return;
  }
 else {
    mState.selectedIconIndex=index;
    Bitmap selectionBitmap=mSelectionBitmap;
    Utilities.drawSelectedAllAppsBitmap(mSelectionCanvas,selectionBitmap.getWidth(),selectionBitmap.getHeight(),mAllAppsList.get(index).iconBitmap);
    mSelectedIcon=Allocation.createFromBitmap(mRS,selectionBitmap,Element.RGBA_8888(mRS),false);
    mSelectedIcon.uploadToTexture(0);
    mState.selectedIconTexture=mSelectedIcon.getID();
  }
}

Fixed version (ground truth):
void selectIcon(int index){
  if (index < 0) {
    mState.selectedIconIndex=-1;
  }
 else {
    mState.selectedIconIndex=index;
    Bitmap selectionBitmap=mSelectionBitmap;
    Utilities.drawSelectedAllAppsBitmap(mSelectionCanvas,selectionBitmap.getWidth(),selectionBitmap.getHeight(),mAllAppsList.get(index).iconBitmap);
    mSelectedIcon=Allocation.createFromBitmap(mRS,selectionBitmap,Element.RGBA_8888(mRS),false);
    mSelectedIcon.uploadToTexture(0);
    mState.selectedIconTexture=mSelectedIcon.getID();
  }
}
Program: 45642
Project: 45642
Buggy source:
public boolean onLongClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return true;
  }
  int index=mRollo.mState.selectedIconIndex;
  if (mRollo.checkClickOK() && index >= 0 && index < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(index);
    int screenX=mMotionDownRawX - (mDefines.ICON_WIDTH_PX / 2);
    int screenY=mMotionDownRawY - mDefines.ICON_HEIGHT_PX;
    int left=(mDefines.ICON_TEXTURE_WIDTH_PX - mDefines.ICON_WIDTH_PX) / 2;
    int top=(mDefines.ICON_TEXTURE_HEIGHT_PX - mDefines.ICON_HEIGHT_PX) / 2;
    mDragController.startDrag(app.iconBitmap,screenX,screenY,left,top,mDefines.ICON_WIDTH_PX,mDefines.ICON_HEIGHT_PX,this,app,DragController.DRAG_ACTION_COPY);
    mLauncher.closeAllApps(true);
  }
  return true;
}

Fixed version (ground truth):
public boolean onLongClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return true;
  }
  if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex && mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(mCurrentIconIndex);
    int screenX=mMotionDownRawX - (mDefines.ICON_WIDTH_PX / 2);
    int screenY=mMotionDownRawY - mDefines.ICON_HEIGHT_PX;
    int left=(mDefines.ICON_TEXTURE_WIDTH_PX - mDefines.ICON_WIDTH_PX) / 2;
    int top=(mDefines.ICON_TEXTURE_HEIGHT_PX - mDefines.ICON_HEIGHT_PX) / 2;
    mDragController.startDrag(app.iconBitmap,screenX,screenY,left,top,mDefines.ICON_WIDTH_PX,mDefines.ICON_HEIGHT_PX,this,app,DragController.DRAG_ACTION_COPY);
    mLauncher.closeAllApps(true);
  }
  return true;
}
Program: 45643
Project: 45643
Buggy source:
public void onClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return;
  }
  int index=mRollo.mState.selectedIconIndex;
  if (mRollo.checkClickOK() && index >= 0 && index < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(index);
    mLauncher.startActivitySafely(app.intent);
  }
}

Fixed version (ground truth):
public void onClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return;
  }
  if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex && mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(mCurrentIconIndex);
    mLauncher.startActivitySafely(app.intent);
  }
}
Program: 45645
Project: 45645
Buggy source:
void selectIcon(int index){
  int iconCount=mAllAppsList.size();
  if (index < 0 || index >= iconCount) {
    mState.selectedIconIndex=-1;
    return;
  }
 else {
    mState.selectedIconIndex=index;
    Bitmap selectionBitmap=mSelectionBitmap;
    Utilities.drawSelectedAllAppsBitmap(mSelectionCanvas,selectionBitmap.getWidth(),selectionBitmap.getHeight(),mAllAppsList.get(index).iconBitmap);
    mSelectedIcon=Allocation.createFromBitmap(mRS,selectionBitmap,Element.RGBA_8888(mRS),false);
    mSelectedIcon.uploadToTexture(0);
    mState.selectedIconTexture=mSelectedIcon.getID();
  }
}

Fixed version (ground truth):
void selectIcon(int index){
  if (index < 0) {
    mState.selectedIconIndex=-1;
  }
 else {
    mState.selectedIconIndex=index;
    Bitmap selectionBitmap=mSelectionBitmap;
    Utilities.drawSelectedAllAppsBitmap(mSelectionCanvas,selectionBitmap.getWidth(),selectionBitmap.getHeight(),mAllAppsList.get(index).iconBitmap);
    mSelectedIcon=Allocation.createFromBitmap(mRS,selectionBitmap,Element.RGBA_8888(mRS),false);
    mSelectedIcon.uploadToTexture(0);
    mState.selectedIconTexture=mSelectedIcon.getID();
  }
}
Program: 45646
Project: 45646
Buggy source:
public boolean onLongClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return true;
  }
  int index=mRollo.mState.selectedIconIndex;
  if (mRollo.checkClickOK() && index >= 0 && index < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(index);
    int screenX=mMotionDownRawX - (mDefines.ICON_WIDTH_PX / 2);
    int screenY=mMotionDownRawY - mDefines.ICON_HEIGHT_PX;
    int left=(mDefines.ICON_TEXTURE_WIDTH_PX - mDefines.ICON_WIDTH_PX) / 2;
    int top=(mDefines.ICON_TEXTURE_HEIGHT_PX - mDefines.ICON_HEIGHT_PX) / 2;
    mDragController.startDrag(app.iconBitmap,screenX,screenY,left,top,mDefines.ICON_WIDTH_PX,mDefines.ICON_HEIGHT_PX,this,app,DragController.DRAG_ACTION_COPY);
    mLauncher.closeAllApps(true);
  }
  return true;
}

Fixed version (ground truth):
public boolean onLongClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return true;
  }
  if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex && mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(mCurrentIconIndex);
    int screenX=mMotionDownRawX - (mDefines.ICON_WIDTH_PX / 2);
    int screenY=mMotionDownRawY - mDefines.ICON_HEIGHT_PX;
    int left=(mDefines.ICON_TEXTURE_WIDTH_PX - mDefines.ICON_WIDTH_PX) / 2;
    int top=(mDefines.ICON_TEXTURE_HEIGHT_PX - mDefines.ICON_HEIGHT_PX) / 2;
    mDragController.startDrag(app.iconBitmap,screenX,screenY,left,top,mDefines.ICON_WIDTH_PX,mDefines.ICON_HEIGHT_PX,this,app,DragController.DRAG_ACTION_COPY);
    mLauncher.closeAllApps(true);
  }
  return true;
}
Program: 45648
Project: 45648
Buggy source:
public boolean onTouchEvent(MotionEvent ev){
  if (mVelocityTracker == null) {
    mVelocityTracker=VelocityTracker.obtain();
  }
  mVelocityTracker.addMovement(ev);
  final int screenX=(int)ev.getRawX();
  final int screenY=(int)ev.getRawY();
  final int deltaX=screenX - mDownX;
  final int deltaY=screenY - mDownY;
  final int action=ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
    mCanceled=false;
  mTracking=false;
mDownX=screenX;
mDownY=screenY;
mAllAppsView.setZoomSwipeInProgress(true,true);
break;
case MotionEvent.ACTION_MOVE:
if (!mCanceled && !mTracking) {
if (Math.abs(deltaX) > mSlop) {
mCanceled=true;
mTracking=false;
mAllAppsView.setZoomSwipeInProgress(false,true);
}
if (Math.abs(deltaY) > mSlop) {
mTracking=true;
}
}
if (mTracking && !mCanceled) {
track(screenY);
}
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mTracking && !mCanceled) {
fling(screenY);
mAllAppsView.setZoomSwipeInProgress(false,false);
}
mVelocityTracker.recycle();
mVelocityTracker=null;
break;
}
return mTracking || mCanceled;
}

Fixed version (ground truth):
public boolean onTouchEvent(MotionEvent ev){
  if (mVelocityTracker == null) {
    mVelocityTracker=VelocityTracker.obtain();
  }
  mVelocityTracker.addMovement(ev);
  final int screenX=(int)ev.getRawX();
  final int screenY=(int)ev.getRawY();
  final int deltaX=screenX - mDownX;
  final int deltaY=screenY - mDownY;
  final int action=ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
    mCanceled=false;
  mTracking=false;
mDownX=screenX;
mDownY=screenY;
mAllAppsView.setZoomSwipeInProgress(true,true);
break;
case MotionEvent.ACTION_MOVE:
if (!mCanceled && !mTracking) {
if (Math.abs(deltaX) > mSlopX) {
mCanceled=true;
mTracking=false;
mAllAppsView.setZoomSwipeInProgress(false,true);
}
 else if (Math.abs(deltaY) > mSlopY) {
mTracking=true;
}
}
if (mTracking && !mCanceled) {
track(screenY);
}
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mTracking && !mCanceled) {
fling(screenY);
mAllAppsView.setZoomSwipeInProgress(false,false);
}
mVelocityTracker.recycle();
mVelocityTracker=null;
break;
}
return mTracking || mCanceled;
}
Program: 45649
Project: 45649
Buggy source:
public SwipeController(Context context){
  ViewConfiguration config=ViewConfiguration.get(context);
  mSlop=config.getScaledTouchSlop();
  DisplayMetrics display=context.getResources().getDisplayMetrics();
  mSwipeDistance=display.heightPixels / 2;
  setMode(MODE_WORKSPACE,false);
}

Fixed version (ground truth):
public SwipeController(Context context){
  ViewConfiguration config=ViewConfiguration.get(context);
  mSlopX=config.getScaledTouchSlop();
  mSlopY=3 * mSlopX / 2;
  DisplayMetrics display=context.getResources().getDisplayMetrics();
  mSwipeDistance=display.heightPixels / 2;
  setMode(MODE_WORKSPACE,false);
}
Program: 45652
Project: 45652
Buggy source:
public boolean onTouchEvent(MotionEvent ev){
  if (mVelocityTracker == null) {
    mVelocityTracker=VelocityTracker.obtain();
  }
  mVelocityTracker.addMovement(ev);
  final int screenX=(int)ev.getRawX();
  final int screenY=(int)ev.getRawY();
  final int deltaX=screenX - mDownX;
  final int deltaY=screenY - mDownY;
  final int action=ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
    mCanceled=false;
  mTracking=false;
mDownX=screenX;
mDownY=screenY;
mAllAppsView.setZoomSwipeInProgress(true,true);
break;
case MotionEvent.ACTION_MOVE:
if (!mCanceled && !mTracking) {
if (Math.abs(deltaX) > mSlop) {
mCanceled=true;
mTracking=false;
mAllAppsView.setZoomSwipeInProgress(false,true);
}
if (Math.abs(deltaY) > mSlop) {
mTracking=true;
}
}
if (mTracking && !mCanceled) {
track(screenY);
}
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mTracking && !mCanceled) {
fling(screenY);
mAllAppsView.setZoomSwipeInProgress(false,false);
}
mVelocityTracker.recycle();
mVelocityTracker=null;
break;
}
return mTracking || mCanceled;
}

Fixed version (ground truth):
public boolean onTouchEvent(MotionEvent ev){
  if (mVelocityTracker == null) {
    mVelocityTracker=VelocityTracker.obtain();
  }
  mVelocityTracker.addMovement(ev);
  final int screenX=(int)ev.getRawX();
  final int screenY=(int)ev.getRawY();
  final int deltaX=screenX - mDownX;
  final int deltaY=screenY - mDownY;
  final int action=ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
    mCanceled=false;
  mTracking=false;
mDownX=screenX;
mDownY=screenY;
mAllAppsView.setZoomSwipeInProgress(true,true);
break;
case MotionEvent.ACTION_MOVE:
if (!mCanceled && !mTracking) {
if (Math.abs(deltaX) > mSlopX) {
mCanceled=true;
mTracking=false;
mAllAppsView.setZoomSwipeInProgress(false,true);
}
 else if (Math.abs(deltaY) > mSlopY) {
mTracking=true;
}
}
if (mTracking && !mCanceled) {
track(screenY);
}
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mTracking && !mCanceled) {
fling(screenY);
mAllAppsView.setZoomSwipeInProgress(false,false);
}
mVelocityTracker.recycle();
mVelocityTracker=null;
break;
}
return mTracking || mCanceled;
}
Program: 45653
Project: 45653
Buggy source:
public SwipeController(Context context){
  ViewConfiguration config=ViewConfiguration.get(context);
  mSlop=config.getScaledTouchSlop();
  DisplayMetrics display=context.getResources().getDisplayMetrics();
  mSwipeDistance=display.heightPixels / 2;
  setMode(MODE_WORKSPACE,false);
}

Fixed version (ground truth):
public SwipeController(Context context){
  ViewConfiguration config=ViewConfiguration.get(context);
  mSlopX=config.getScaledTouchSlop();
  mSlopY=3 * mSlopX / 2;
  DisplayMetrics display=context.getResources().getDisplayMetrics();
  mSwipeDistance=display.heightPixels / 2;
  setMode(MODE_WORKSPACE,false);
}
Program: 45655
Project: 45655
Buggy source:
public void onDrop(DragSource source,int x,int y,int xOffset,int yOffset,DragView dragView,Object dragInfo){
  final CellLayout cellLayout=getCurrentDropLayout();
  if (source != this) {
    onDropExternal(x - xOffset,y - yOffset,dragInfo,cellLayout);
  }
 else {
    if (mDragInfo != null) {
      final View cell=mDragInfo.cell;
      if (mCurrentScreen != mDragInfo.screen) {
        final CellLayout originalCellLayout=(CellLayout)getChildAt(mDragInfo.screen);
        originalCellLayout.removeView(cell);
        cellLayout.addView(cell);
      }
      mTargetCell=estimateDropCell(x - xOffset,y - yOffset,mDragInfo.spanX,mDragInfo.spanY,cell,cellLayout,mTargetCell);
      cellLayout.onDropChild(cell,mTargetCell);
      final ItemInfo info=(ItemInfo)cell.getTag();
      CellLayout.LayoutParams lp=(CellLayout.LayoutParams)cell.getLayoutParams();
      LauncherModel.moveItemInDatabase(mLauncher,info,LauncherSettings.Favorites.CONTAINER_DESKTOP,mCurrentScreen,lp.cellX,lp.cellY);
    }
  }
}

Fixed version (ground truth):
public void onDrop(DragSource source,int x,int y,int xOffset,int yOffset,DragView dragView,Object dragInfo){
  final CellLayout cellLayout=getCurrentDropLayout();
  if (source != this) {
    onDropExternal(x - xOffset,y - yOffset,dragInfo,cellLayout);
  }
 else {
    if (mDragInfo != null) {
      final View cell=mDragInfo.cell;
      int index=mScroller.isFinished() ? mCurrentScreen : mNextScreen;
      if (index != mDragInfo.screen) {
        final CellLayout originalCellLayout=(CellLayout)getChildAt(mDragInfo.screen);
        originalCellLayout.removeView(cell);
        cellLayout.addView(cell);
      }
      mTargetCell=estimateDropCell(x - xOffset,y - yOffset,mDragInfo.spanX,mDragInfo.spanY,cell,cellLayout,mTargetCell);
      cellLayout.onDropChild(cell,mTargetCell);
      final ItemInfo info=(ItemInfo)cell.getTag();
      CellLayout.LayoutParams lp=(CellLayout.LayoutParams)cell.getLayoutParams();
      LauncherModel.moveItemInDatabase(mLauncher,info,LauncherSettings.Favorites.CONTAINER_DESKTOP,index,lp.cellX,lp.cellY);
    }
  }
}
Program: 45657
Project: 45657
Buggy source:
private void addMissingResSpecs() throws AndrolibException {
  int resId=mResId & 0xffff0000;
  for (int i=0; i < mMissingResSpecs.length; i++) {
    if (!mMissingResSpecs[i]) {
      continue;
    }
    ResResSpec spec=new ResResSpec(new ResID(resId | i),String.format("String_Node_Str",i),mPkg,mTypeSpec);
    if (!mPkg.hasResSpec(new ResID(resId | i))) {
      mPkg.addResSpec(spec);
      mTypeSpec.addResSpec(spec);
      if (mType == null) {
        mType=mPkg.getOrCreateConfig(new ResConfigFlags());
      }
      ResValue value=new ResBoolValue(false,0,null);
      ResResource res=new ResResource(mType,spec,value);
      mPkg.addResource(res);
      mType.addResource(res);
      spec.addResource(res);
    }
  }
}

Fixed version (ground truth):
private void addMissingResSpecs() throws AndrolibException {
  int resId=mResId & 0xffff0000;
  for (int i=0; i < mMissingResSpecs.length; i++) {
    if (!mMissingResSpecs[i]) {
      continue;
    }
    ResResSpec spec=new ResResSpec(new ResID(resId | i),"String_Node_Str" + Integer.toHexString(i),mPkg,mTypeSpec);
    if (!mPkg.hasResSpec(new ResID(resId | i))) {
      mPkg.addResSpec(spec);
      mTypeSpec.addResSpec(spec);
      if (mType == null) {
        mType=mPkg.getOrCreateConfig(new ResConfigFlags());
      }
      ResValue value=new ResBoolValue(false,0,null);
      ResResource res=new ResResource(mType,spec,value);
      mPkg.addResource(res);
      mType.addResource(res);
      spec.addResource(res);
    }
  }
}
Program: 45658
Project: 45658
Buggy source:
public void recordUncompressedFiles(ExtFile apkFile,Collection<String> uncompressedExtensions) throws AndrolibException {
  try {
    Directory unk=apkFile.getDirectory();
    Set<String> files=unk.getFiles(true);
    String ext;
    for (    String file : files) {
      if (isAPKFileNames(file) && !NO_COMPRESS_PATTERN.matcher(file).find()) {
        if (unk.getCompressionLevel(file) == 0) {
          ext=FilenameUtils.getExtension(file);
          if (!uncompressedExtensions.contains(ext)) {
            uncompressedExtensions.add(FilenameUtils.getExtension(file));
          }
        }
      }
    }
  }
 catch (  DirectoryException ex) {
    throw new AndrolibException(ex);
  }
}

Fixed version (ground truth):
public void recordUncompressedFiles(ExtFile apkFile,Collection<String> uncompressedExtensions) throws AndrolibException {
  try {
    Directory unk=apkFile.getDirectory();
    Set<String> files=unk.getFiles(true);
    String ext;
    for (    String file : files) {
      if (isAPKFileNames(file) && !NO_COMPRESS_PATTERN.matcher(file).find()) {
        if (unk.getCompressionLevel(file) == 0) {
          ext=FilenameUtils.getExtension(file);
          if (ext.isEmpty()) {
            ext=file;
          }
          if (!uncompressedExtensions.contains(ext)) {
            uncompressedExtensions.add(ext);
          }
        }
      }
    }
  }
 catch (  DirectoryException ex) {
    throw new AndrolibException(ex);
  }
}
Program: 45659
Project: 45659
Buggy source:
@Override public void write(String str,int start,int len) throws IOException {
  final int end=start + len;
  int pos=start;
  while (pos < end) {
    pos=str.indexOf('\n',start);
    if (pos == -1) {
      writeLine(str,start,end - start);
      return;
    }
 else {
      writeLine(str,start,pos - start);
      writer.write(newLine);
      beginningOfLine=true;
      start=pos + 1;
    }
  }
}

Fixed version (ground truth):
@Override public void write(String str,int start,int len) throws IOException {
  final int end=start + len;
  int pos=start;
  while (pos < end) {
    pos=str.indexOf('\n',start);
    if (pos == -1 || pos >= end) {
      writeLine(str,start,end - start);
      return;
    }
 else {
      writeLine(str,start,pos - start);
      writer.write(newLine);
      beginningOfLine=true;
      start=pos + 1;
    }
  }
}
Program: 45660
Project: 45660
Buggy source:
/** 
 * {@inheritDoc} 
 */
public int readSleb128(){
  int end=offset;
  int currentByteValue;
  int result;
  byte[] buf=dexBuf.buf;
  result=buf[end++] & 0xff;
  if (result <= 0x7f) {
    result=(result << 25) >> 25;
  }
 else {
    currentByteValue=buf[end++] & 0xff;
    result=(result & 0x7f) | ((currentByteValue & 0x7f) << 7);
    if (currentByteValue <= 0x7f) {
      result=(result << 18) >> 18;
    }
 else {
      currentByteValue=buf[end++] & 0xff;
      result|=(currentByteValue & 0x7f) << 14;
      if (currentByteValue <= 0x7f) {
        result=(result << 11) >> 11;
      }
 else {
        currentByteValue=buf[end++] & 0xff;
        result|=(currentByteValue & 0x7f) << 21;
        if (currentByteValue <= 0x7f) {
          result=(result << 4) >> 4;
        }
 else {
          currentByteValue=buf[end++] & 0xff;
          if (currentByteValue > 0x7f) {
            throw new ExceptionWithContext("String_Node_Str",offset);
          }
          result|=currentByteValue << 28;
        }
      }
    }
  }
  offset=end;
  return result;
}

Fixed version (ground truth):
public int readSleb128(){
  int end=offset;
  int currentByteValue;
  int result;
  byte[] buf=dexBuf.buf;
  result=buf[end++] & 0xff;
  if (result <= 0x7f) {
    result=(result << 25) >> 25;
  }
 else {
    currentByteValue=buf[end++] & 0xff;
    result=(result & 0x7f) | ((currentByteValue & 0x7f) << 7);
    if (currentByteValue <= 0x7f) {
      result=(result << 18) >> 18;
    }
 else {
      currentByteValue=buf[end++] & 0xff;
      result|=(currentByteValue & 0x7f) << 14;
      if (currentByteValue <= 0x7f) {
        result=(result << 11) >> 11;
      }
 else {
        currentByteValue=buf[end++] & 0xff;
        result|=(currentByteValue & 0x7f) << 21;
        if (currentByteValue <= 0x7f) {
          result=(result << 4) >> 4;
        }
 else {
          currentByteValue=buf[end++] & 0xff;
          if (currentByteValue > 0x7f) {
            throw new ExceptionWithContext("String_Node_Str",offset);
          }
          result|=currentByteValue << 28;
        }
      }
    }
  }
  offset=end;
  return result;
}
Program: 45661
Project: 45661
Buggy source:
/** 
 * The code address
 * @return
 */
int getCodeAddress();

Fixed version (ground truth):
/** 
 * @return The code address
 */
int getCodeAddress();
Program: 45662
Project: 45662
Buggy source:
/** 
 * Gets the width of the right side containing the annotations
 * @return
 */
public int getAnnotationWidth(){
  int leftWidth=8 + (hexCols * 2) + (hexCols / 2);
  return outputWidth - leftWidth;
}

Fixed version (ground truth):
/** 
 * @return The width of the right side containing the annotations
 */
public int getAnnotationWidth(){
  int leftWidth=8 + (hexCols * 2) + (hexCols / 2);
  return outputWidth - leftWidth;
}
Program: 45663
Project: 45663
Buggy source:
/** 
 * Delete a key and its associated value from the tree.
 * @param key The key of the node that need to be deleted
 * @return
 */
public boolean delete(String key);

Fixed version (ground truth):
/** 
 * Delete a key and its associated value from the tree.
 * @param key The key of the node that need to be deleted
 * @return True if the key was deleted, false if not found
 */
public boolean delete(String key);
Program: 45664
Project: 45664
Buggy source:
/** 
 * Attempt to find the width of the console. If it can't get the width, return a default of 80
 * @return
 */
public static int getConsoleWidth(){
  if (System.getProperty("String_Node_Str").toLowerCase().contains("String_Node_Str")) {
    try {
      return attemptMode();
    }
 catch (    Exception ex) {
    }
  }
 else {
    try {
      return attemptStty();
    }
 catch (    Exception ex) {
    }
  }
  return 80;
}

Fixed version (ground truth):
/** 
 * Attempt to find the width of the console. If it can't get the width, return a default of 80
 * @return The current console width
 */
public static int getConsoleWidth(){
  if (System.getProperty("String_Node_Str").toLowerCase().contains("String_Node_Str")) {
    try {
      return attemptMode();
    }
 catch (    Exception ex) {
    }
  }
 else {
    try {
      return attemptStty();
    }
 catch (    Exception ex) {
    }
  }
  return 80;
}
Program: 45665
Project: 45665
Buggy source:
BuilderClassDef(@Nonnull BuilderTypeReference type,int accessFlags,@Nullable BuilderTypeReference superclass,@Nonnull BuilderTypeList interfaces,@Nullable BuilderStringReference sourceFile,@Nonnull BuilderAnnotationSet annotations,@Nullable Iterable<? extends BuilderField> fields,@Nullable Iterable<? extends BuilderMethod> methods){
  if (fields == null) {
    fields=ImmutableList.of();
  }
  if (methods == null) {
    methods=ImmutableList.of();
  }
  this.type=type;
  this.accessFlags=accessFlags;
  this.superclass=superclass;
  this.interfaces=interfaces;
  this.sourceFile=sourceFile;
  this.annotations=annotations;
  this.staticFields=ImmutableSortedSet.copyOf(Iterables.filter(fields,FieldUtil.FIELD_IS_STATIC));
  this.instanceFields=ImmutableSortedSet.copyOf(Iterables.filter(fields,FieldUtil.FIELD_IS_INSTANCE));
  this.directMethods=ImmutableSortedSet.copyOf(Iterables.filter(methods,MethodUtil.METHOD_IS_DIRECT));
  this.virtualMethods=ImmutableSortedSet.copyOf(Iterables.filter(methods,MethodUtil.METHOD_IS_VIRTUAL));
}

Fixed version (ground truth):
BuilderClassDef(@Nonnull BuilderTypeReference type,int accessFlags,@Nullable BuilderTypeReference superclass,@Nonnull BuilderTypeList interfaces,@Nullable BuilderStringReference sourceFile,@Nonnull BuilderAnnotationSet annotations,@Nullable Iterable<? extends BuilderField> fields,@Nullable Iterable<? extends BuilderMethod> methods){
  if (fields == null) {
    fields=ImmutableList.of();
  }
  if (methods == null) {
    methods=ImmutableList.of();
  }
  this.type=type;
  this.accessFlags=accessFlags;
  this.superclass=superclass;
  this.interfaces=interfaces;
  this.sourceFile=sourceFile;
  this.annotations=annotations;
  this.staticFields=ImmutableSortedSet.copyOf((Iterable<? extends BuilderField>)Iterables.filter(fields,FieldUtil.FIELD_IS_STATIC));
  this.instanceFields=ImmutableSortedSet.copyOf((Iterable<? extends BuilderField>)Iterables.filter(fields,FieldUtil.FIELD_IS_INSTANCE));
  this.directMethods=ImmutableSortedSet.copyOf((Iterable<? extends BuilderMethod>)Iterables.filter(methods,MethodUtil.METHOD_IS_DIRECT));
  this.virtualMethods=ImmutableSortedSet.copyOf((Iterable<? extends BuilderMethod>)Iterables.filter(methods,MethodUtil.METHOD_IS_VIRTUAL));
}
Program: 45666
Project: 45666
Buggy source:
private void insertFile(URI apkFileSystem,Map<String,String> zip_properties,File insert,String method,Path location) throws AndrolibException, IOException {
  try (FileSystem fs=FileSystems.newFileSystem(apkFileSystem,zip_properties)){
    Path root=fs.getPath("String_Node_Str");
    Path dest=fs.getPath(root.toString() + insert.getAbsolutePath().replace(location.toString(),"String_Node_Str"));
    Path newFile=Paths.get(insert.getAbsolutePath());
    Files.copy(newFile,dest,StandardCopyOption.REPLACE_EXISTING);
    fs.close();
  }
 }

Fixed version (ground truth):
private void insertFile(URI apkFileSystem,Map<String,String> zip_properties,File insert,String method,Path location) throws AndrolibException, IOException {
  try (FileSystem fs=FileSystems.newFileSystem(apkFileSystem,zip_properties)){
    Path root=fs.getPath("String_Node_Str");
    Path dest=fs.getPath(root.toString(),insert.getAbsolutePath().replace(location.toString(),"String_Node_Str"));
    Path newFile=Paths.get(insert.getAbsolutePath());
    Files.copy(newFile,dest,StandardCopyOption.REPLACE_EXISTING);
    fs.close();
  }
 }
Program: 45667
Project: 45667
Buggy source:
private void insertFolder(URI apkFileSystem,Map<String,String> zip_properties,File insert,String method,Path location) throws AndrolibException, IOException {
  try (FileSystem fs=FileSystems.newFileSystem(apkFileSystem,zip_properties)){
    Path root=fs.getPath("String_Node_Str");
    Path dest=fs.getPath(root.toString() + insert.getAbsolutePath().replace(location.toString(),"String_Node_Str"));
    Path parent=dest.normalize();
    if (parent != null && Files.notExists(parent)) {
      if (!Files.isDirectory(parent,LinkOption.NOFOLLOW_LINKS)) {
        Files.createDirectories(parent);
      }
    }
    fs.close();
  }
 }

Fixed version (ground truth):
private void insertFolder(URI apkFileSystem,Map<String,String> zip_properties,File insert,String method,Path location) throws AndrolibException, IOException {
  try (FileSystem fs=FileSystems.newFileSystem(apkFileSystem,zip_properties)){
    Path root=fs.getPath("String_Node_Str");
    Path dest=fs.getPath(root.toString(),insert.getAbsolutePath().replace(location.toString(),"String_Node_Str"));
    Path parent=dest.normalize();
    if (parent != null && Files.notExists(parent)) {
      if (!Files.isDirectory(parent,LinkOption.NOFOLLOW_LINKS)) {
        Files.createDirectories(parent);
      }
    }
    fs.close();
  }
 }
Program: 45668
Project: 45668
Buggy source:
@Nonnull public ClassDef getClassDef(String type){
  if (dontLoadClassPath) {
    return null;
  }
  ClassDef ret=availableClasses.get(type);
  if (ret == null) {
    throw new UnresolvedClassException("String_Node_Str",type);
  }
  return ret;
}

Fixed version (ground truth):
@Nonnull public ClassDef getClassDef(String type){
  if (dontLoadClassPath) {
    throw new UnresolvedClassException("String_Node_Str",type);
  }
  ClassDef ret=availableClasses.get(type);
  if (ret == null) {
    throw new UnresolvedClassException("String_Node_Str",type);
  }
  return ret;
}
Program: 45670
Project: 45670
Buggy source:
private void decode() throws AndrolibException {
  try {
    ClassPath.dontLoadClassPath=mDebug;
    baksmaliOptions options=new baksmaliOptions();
    options.deodex=false;
    options.outputDirectory=mOutDir.toAbsolutePath().toString();
    options.noParameterRegisters=false;
    options.useLocalsDirective=true;
    options.useSequentialLabels=true;
    options.outputDebugInfo=mBakDeb;
    options.addCodeOffsets=false;
    options.jobs=-1;
    options.noAccessorComments=false;
    options.registerInfo=(mDebug ? baksmaliOptions.DIFFPRE : 0);
    options.ignoreErrors=false;
    options.inlineResolver=null;
    options.checkPackagePrivateAccess=false;
    if (options.jobs <= 0) {
      if (mDebug) {
        options.jobs=1;
      }
 else {
        options.jobs=Runtime.getRuntime().availableProcessors();
        if (options.jobs > 6) {
          options.jobs=6;
        }
      }
    }
    DexBackedDexFile dexFile=DexFileFactory.loadDexFile(mApkFile,mApi);
    if (dexFile.isOdexFile()) {
      throw new AndrolibException("String_Node_Str");
    }
    if (options.inlineResolver == null && dexFile instanceof DexBackedOdexFile) {
      options.inlineResolver=InlineMethodResolver.createInlineMethodResolver(((DexBackedOdexFile)dexFile).getOdexVersion());
    }
    baksmali.disassembleDexFile(dexFile,options);
    if (mDebug) {
      Files.walkFileTree(mOutDir,new SmaliFileVisitor());
    }
  }
 catch (  IOException ex) {
    throw new AndrolibException(ex);
  }
}

Fixed version (ground truth):
private void decode() throws AndrolibException {
  try {
    ClassPath.dontLoadClassPath=mDebug;
    baksmaliOptions options=new baksmaliOptions();
    options.deodex=false;
    options.outputDirectory=mOutDir.toAbsolutePath().toString();
    options.noParameterRegisters=false;
    options.useLocalsDirective=true;
    options.useSequentialLabels=true;
    options.outputDebugInfo=mBakDeb;
    options.addCodeOffsets=false;
    options.jobs=-1;
    options.noAccessorComments=false;
    options.registerInfo=(mDebug ? baksmaliOptions.DIFFPRE : 0);
    options.ignoreErrors=false;
    options.inlineResolver=null;
    options.checkPackagePrivateAccess=false;
    if (options.jobs <= 0) {
      if (mDebug) {
        options.jobs=1;
      }
 else {
        options.jobs=Runtime.getRuntime().availableProcessors();
        if (options.jobs > 6) {
          options.jobs=6;
        }
      }
    }
    DexBackedDexFile dexFile=DexFileFactory.loadDexFile(mApkFile,mApi);
    if (dexFile.isOdexFile()) {
      throw new AndrolibException("String_Node_Str");
    }
    if (dexFile instanceof DexBackedOdexFile) {
      options.inlineResolver=InlineMethodResolver.createInlineMethodResolver(((DexBackedOdexFile)dexFile).getOdexVersion());
    }
    baksmali.disassembleDexFile(dexFile,options);
    if (mDebug) {
      Files.walkFileTree(mOutDir,new SmaliFileVisitor());
    }
  }
 catch (  IOException ex) {
    throw new AndrolibException(ex);
  }
}
Program: 45674
Project: 45674
Buggy source:
public void adjust_package_manifest(ResTable resTable,String filePath) throws AndrolibException {
  Map<String,String> packageInfo=resTable.getPackageInfo();
  if ((packageInfo.get("String_Node_Str").equalsIgnoreCase(packageInfo.get("String_Node_Str")) || ("String_Node_Str".equalsIgnoreCase(packageInfo.get("String_Node_Str")) || ("String_Node_Str".equalsIgnoreCase(packageInfo.get("String_Node_Str")))))) {
    LOGGER.info("String_Node_Str");
  }
 else {
    try {
      LOGGER.info("String_Node_Str");
      DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
      Document doc=docBuilder.parse(filePath.toString());
      Node manifest=doc.getFirstChild();
      NamedNodeMap attr=manifest.getAttributes();
      Node nodeAttr=attr.getNamedItem("String_Node_Str");
      mPackageRenamed=nodeAttr.getNodeValue();
      nodeAttr.setNodeValue(packageInfo.get("String_Node_Str"));
      TransformerFactory transformerFactory=TransformerFactory.newInstance();
      Transformer transformer=transformerFactory.newTransformer();
      DOMSource source=new DOMSource(doc);
      StreamResult result=new StreamResult(new File(filePath));
      transformer.transform(source,result);
    }
 catch (    SAXException|ParserConfigurationException|IOException|TransformerException ex) {
      throw new AndrolibException(ex);
    }
  }
}

Fixed version (ground truth):
public void adjust_package_manifest(ResTable resTable,String filePath) throws AndrolibException {
  Map<String,String> packageInfo=resTable.getPackageInfo();
  if ((packageInfo.get("String_Node_Str").equalsIgnoreCase(packageInfo.get("String_Node_Str")) || ("String_Node_Str".equalsIgnoreCase(packageInfo.get("String_Node_Str")) || ("String_Node_Str".equalsIgnoreCase(packageInfo.get("String_Node_Str")))))) {
    LOGGER.info("String_Node_Str");
  }
 else {
    try {
      LOGGER.info("String_Node_Str");
      DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
      Document doc=docBuilder.parse(filePath.toString());
      Node manifest=doc.getFirstChild();
      NamedNodeMap attr=manifest.getAttributes();
      Node nodeAttr=attr.getNamedItem("String_Node_Str");
      mPackageRenamed=nodeAttr.getNodeValue();
      nodeAttr.setNodeValue(packageInfo.get("String_Node_Str"));
      TransformerFactory transformerFactory=TransformerFactory.newInstance();
      Transformer transformer=transformerFactory.newTransformer();
      transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
      transformer.setOutputProperty(OutputKeys.STANDALONE,"String_Node_Str");
      DOMSource source=new DOMSource(doc);
      StreamResult result=new StreamResult(new File(filePath));
      transformer.transform(source,result);
    }
 catch (    SAXException|ParserConfigurationException|IOException|TransformerException ex) {
      throw new AndrolibException(ex);
    }
  }
}
Program: 45675
Project: 45675
Buggy source:
public void remove_manifest_versions(String filePath) throws AndrolibException {
  File f=new File(filePath);
  if (f.exists()) {
    try {
      DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
      Document doc=docBuilder.parse(filePath.toString());
      Node manifest=doc.getFirstChild();
      NamedNodeMap attr=manifest.getAttributes();
      Node vCode=attr.getNamedItem("String_Node_Str");
      Node vName=attr.getNamedItem("String_Node_Str");
      if (vCode != null) {
        attr.removeNamedItem("String_Node_Str");
      }
      if (vName != null) {
        attr.removeNamedItem("String_Node_Str");
      }
      TransformerFactory transformerFactory=TransformerFactory.newInstance();
      Transformer transformer=transformerFactory.newTransformer();
      DOMSource source=new DOMSource(doc);
      StreamResult result=new StreamResult(new File(filePath));
      transformer.transform(source,result);
    }
 catch (    SAXException|ParserConfigurationException|IOException|TransformerException ex) {
      throw new AndrolibException(ex);
    }
  }
}

Fixed version (ground truth):
public void remove_manifest_versions(String filePath) throws AndrolibException {
  File f=new File(filePath);
  if (f.exists()) {
    try {
      DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
      Document doc=docBuilder.parse(filePath.toString());
      Node manifest=doc.getFirstChild();
      NamedNodeMap attr=manifest.getAttributes();
      Node vCode=attr.getNamedItem("String_Node_Str");
      Node vName=attr.getNamedItem("String_Node_Str");
      if (vCode != null) {
        attr.removeNamedItem("String_Node_Str");
      }
      if (vName != null) {
        attr.removeNamedItem("String_Node_Str");
      }
      TransformerFactory transformerFactory=TransformerFactory.newInstance();
      Transformer transformer=transformerFactory.newTransformer();
      transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
      transformer.setOutputProperty(OutputKeys.STANDALONE,"String_Node_Str");
      DOMSource source=new DOMSource(doc);
      StreamResult result=new StreamResult(new File(filePath));
      transformer.transform(source,result);
    }
 catch (    SAXException|ParserConfigurationException|IOException|TransformerException ex) {
      throw new AndrolibException(ex);
    }
  }
}
Program: 45677
Project: 45677
Buggy source:
public void remove_application_debug(String filePath) throws AndrolibException {
  try {
    DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
    Document doc=docBuilder.parse(filePath.toString());
    Node application=doc.getElementById("String_Node_Str");
    NamedNodeMap attr=application.getAttributes();
    Node debugAttr=attr.getNamedItem("String_Node_Str");
    if (debugAttr != null) {
      attr.removeNamedItem("String_Node_Str");
    }
    TransformerFactory transformerFactory=TransformerFactory.newInstance();
    Transformer transformer=transformerFactory.newTransformer();
    DOMSource source=new DOMSource(doc);
    StreamResult result=new StreamResult(new File(filePath));
    transformer.transform(source,result);
  }
 catch (  SAXException|ParserConfigurationException|IOException|TransformerException ex) {
    throw new AndrolibException(ex);
  }
}

Fixed version (ground truth):
public void remove_application_debug(String filePath) throws AndrolibException {
  try {
    DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
    Document doc=docBuilder.parse(filePath.toString());
    Node application=doc.getElementById("String_Node_Str");
    NamedNodeMap attr=application.getAttributes();
    Node debugAttr=attr.getNamedItem("String_Node_Str");
    if (debugAttr != null) {
      attr.removeNamedItem("String_Node_Str");
    }
    TransformerFactory transformerFactory=TransformerFactory.newInstance();
    Transformer transformer=transformerFactory.newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
    transformer.setOutputProperty(OutputKeys.STANDALONE,"String_Node_Str");
    DOMSource source=new DOMSource(doc);
    StreamResult result=new StreamResult(new File(filePath));
    transformer.transform(source,result);
  }
 catch (  SAXException|ParserConfigurationException|IOException|TransformerException ex) {
    throw new AndrolibException(ex);
  }
}
Program: 45678
Project: 45678
Buggy source:
private boolean parseAttr(XmlPullParser pp) throws AndrolibException {
  ResTable restable=resTable;
  for (int i=0; i < pp.getAttributeCount(); i++) {
    final String a_ns="String_Node_Str";
    String ns=pp.getAttributeNamespace(i);
    if (a_ns.equalsIgnoreCase(ns)) {
      String name=pp.getAttributeName(i);
      String value=pp.getAttributeValue(i);
      if (name != null && value != null) {
        if (name.equalsIgnoreCase("String_Node_Str") || name.equalsIgnoreCase("String_Node_Str") || name.equalsIgnoreCase("String_Node_Str")) {
          restable.addSdkInfo(name,value);
        }
 else {
          restable.clearSdkInfo();
          return false;
        }
      }
    }
 else {
      resTable.clearSdkInfo();
      if (i >= pp.getAttributeCount()) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean parseAttr(XmlPullParser pp) throws AndrolibException {
  ResTable restable=resTable;
  for (int i=0; i < pp.getAttributeCount(); i++) {
    final String a_ns="String_Node_Str";
    String ns=pp.getAttributeNamespace(i);
    if (a_ns.equalsIgnoreCase(ns)) {
      String name=pp.getAttributeName(i);
      String value=pp.getAttributeValue(i);
      if (name != null && value != null) {
        if (name.equalsIgnoreCase("String_Node_Str") || name.equalsIgnoreCase("String_Node_Str") || name.equalsIgnoreCase("String_Node_Str")) {
          restable.addSdkInfo(name,value);
        }
 else {
          restable.clearSdkInfo();
          return false;
        }
      }
    }
 else {
      resTable.clearSdkInfo();
      if (i >= pp.getAttributeCount()) {
        return false;
      }
    }
  }
  if (resTable.getAnalysisMode() == true) {
    return false;
  }
 else {
    return true;
  }
}