nus-yam/ex-repair huggingface dataset:
Program: 83847
Project: 83847
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: 83848
Project: 83848
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: 83850
Project: 83850
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: 83851
Project: 83851
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: 83852
Project: 83852
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  mModel.setAllAppsDirty();
  mModel.setWorkspaceDirty();
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}
Program: 83853
Project: 83853
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: 83855
Project: 83855
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: 83856
Project: 83856
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: 83857
Project: 83857
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: 83859
Project: 83859
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: 83860
Project: 83860
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: 83863
Project: 83863
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  mModel.setAllAppsDirty();
  mModel.setWorkspaceDirty();
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}
Program: 83866
Project: 83866
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: 83867
Project: 83867
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: 83869
Project: 83869
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: 83870
Project: 83870
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: 83872
Project: 83872
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: 83873
Project: 83873
Buggy source:
Dialog createDialog(){
  mWaitingForResult=true;
  mAdapter=new AddAdapter(Launcher.this);
  final AlertDialog.Builder builder=new AlertDialog.Builder(Launcher.this);
  builder.setTitle(getString(R.string.menu_item_add_item));
  builder.setAdapter(mAdapter,this);
  builder.setInverseBackgroundForced(true);
  AlertDialog dialog=builder.create();
  dialog.setOnCancelListener(this);
  dialog.setOnDismissListener(this);
  return dialog;
}

Fixed version (ground truth):
Dialog createDialog(){
  mWaitingForResult=true;
  mAdapter=new AddAdapter(Launcher.this);
  final AlertDialog.Builder builder=new AlertDialog.Builder(Launcher.this);
  builder.setTitle(getString(R.string.menu_item_add_item));
  builder.setAdapter(mAdapter,this);
  builder.setInverseBackgroundForced(true);
  AlertDialog dialog=builder.create();
  dialog.setOnCancelListener(this);
  dialog.setOnDismissListener(this);
  dialog.setOnShowListener(this);
  return dialog;
}
Program: 83874
Project: 83874
Buggy source:
@Override protected void onPrepareDialog(int id,Dialog dialog){
switch (id) {
case DIALOG_CREATE_SHORTCUT:
    mWorkspace.lock();
  break;
case DIALOG_RENAME_FOLDER:
mWorkspace.lock();
EditText input=(EditText)dialog.findViewById(R.id.folder_name);
final CharSequence text=mFolderInfo.title;
input.setText(text);
input.setSelection(0,text.length());
break;
}
}

Fixed version (ground truth):
@Override protected void onPrepareDialog(int id,Dialog dialog){
switch (id) {
case DIALOG_CREATE_SHORTCUT:
    break;
case DIALOG_RENAME_FOLDER:
  if (mFolderInfo != null) {
    EditText input=(EditText)dialog.findViewById(R.id.folder_name);
    final CharSequence text=mFolderInfo.title;
    input.setText(text);
    input.setSelection(0,text.length());
  }
break;
}
}
Program: 83876
Project: 83876
Buggy source:
private void loop() throws Exception {
  while (!Thread.currentThread().isInterrupted() && !cancelled) {
    try {
      logger.debug("String_Node_Str");
      String val=this.kestrel.get(this.queueName + "String_Node_Str" + this.timeout+ "String_Node_Str",this.timeout);
      if (val != null) {
        try {
          process(val);
        }
 catch (        ProcessTimeoutException e) {
        }
        logger.debug("String_Node_Str");
        this.kestrel.get(this.queueName + "String_Node_Str");
      }
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
    }
catch (    TimeoutException e) {
      logger.debug("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void loop() throws Exception {
  while (!Thread.currentThread().isInterrupted() && !cancelled) {
    try {
      logger.debug("String_Node_Str");
      String val=this.kestrel.get(this.queueName + "String_Node_Str" + this.timeout+ "String_Node_Str",this.timeout);
      if (val != null) {
        try {
          process(val);
        }
 catch (        ProcessTimeoutException e) {
        }
        logger.debug("String_Node_Str");
        this.kestrel.get(this.queueName + "String_Node_Str");
      }
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
    }
catch (    TimeoutException e) {
      logger.debug("String_Node_Str");
    }
catch (    MemcachedException e) {
      logger.error("String_Node_Str",e);
      Thread.sleep(5000);
    }
catch (    Exception e) {
      logger.error("String_Node_Str",e);
      Thread.sleep(30000);
    }
  }
}
Program: 83877
Project: 83877
Buggy source:
public static int getBlockCurrent(Block b){
  Material mBlock=b.getType();
  int iData=(int)b.getData();
  if (mBlock == Material.LEVER || mBlock == Material.POWERED_RAIL) {
    return (iData & 0x08) == 0x08 ? 15 : 0;
  }
 else   if (mBlock == Material.IRON_DOOR_BLOCK || mBlock == Material.WOODEN_DOOR || mBlock == Material.TRAP_DOOR || mBlock == Material.FENCE_GATE) {
    return (iData & 0x04) == 0x04 ? 15 : 0;
  }
  return b.getBlockPower();
}

Fixed version (ground truth):
public static int getBlockCurrent(Block b){
  Material mBlock=b.getType();
  int iData=(int)b.getData();
  if (mBlock == Material.LEVER || mBlock == Material.POWERED_RAIL) {
    return (iData & 0x08) == 0x08 ? 15 : 0;
  }
 else   if (mBlock == Material.IRON_DOOR_BLOCK || mBlock == Material.WOODEN_DOOR || mBlock == Material.TRAP_DOOR || mBlock == Material.FENCE_GATE) {
    return (iData & 0x04) == 0x04 ? 15 : 0;
  }
 else   if (mBlock == Material.REDSTONE_LAMP_OFF || mBlock == Material.REDSTONE_LAMP_ON || mBlock == Material.REDSTONE_TORCH_OFF || mBlock == Material.REDSTONE_TORCH_ON) {
    return keepAlives.contains(b) ? 15 : 0;
  }
  return b.getBlockPower();
}
Program: 83879
Project: 83879
Buggy source:
public static int getBlockCurrent(Block b){
  Material mBlock=b.getType();
  int iData=(int)b.getData();
  if (mBlock == Material.LEVER || mBlock == Material.POWERED_RAIL) {
    return (iData & 0x08) == 0x08 ? 15 : 0;
  }
 else   if (mBlock == Material.IRON_DOOR_BLOCK || mBlock == Material.WOODEN_DOOR || mBlock == Material.TRAP_DOOR || mBlock == Material.FENCE_GATE) {
    return (iData & 0x04) == 0x04 ? 15 : 0;
  }
 else   if (mBlock == Material.REDSTONE_LAMP_OFF || mBlock == Material.REDSTONE_LAMP_ON || mBlock == Material.REDSTONE_TORCH_OFF || mBlock == Material.REDSTONE_TORCH_ON) {
    return keepAlives.contains(b) ? 15 : 0;
  }
  return b.getBlockPower();
}

Fixed version (ground truth):
public static int getBlockCurrent(Block b){
  Material mBlock=b.getType();
  int iData=(int)b.getData();
  if (mBlock == Material.LEVER || mBlock == Material.POWERED_RAIL) {
    return (iData & 0x08) == 0x08 ? 15 : 0;
  }
 else   if (mBlock == Material.IRON_DOOR_BLOCK || mBlock == Material.WOODEN_DOOR || mBlock == Material.SPRUCE_DOOR || mBlock == Material.BIRCH_DOOR || mBlock == Material.JUNGLE_DOOR || mBlock == Material.ACACIA_DOOR || mBlock == Material.DARK_OAK_DOOR || mBlock == Material.TRAP_DOOR || mBlock == Material.FENCE_GATE || mBlock == Material.SPRUCE_FENCE_GATE || mBlock == Material.BIRCH_FENCE_GATE || mBlock == Material.JUNGLE_FENCE_GATE || mBlock == Material.ACACIA_FENCE_GATE || mBlock == Material.DARK_OAK_FENCE_GATE) {
    return (iData & 0x04) == 0x04 ? 15 : 0;
  }
 else   if (mBlock == Material.REDSTONE_LAMP_OFF || mBlock == Material.REDSTONE_LAMP_ON || mBlock == Material.REDSTONE_TORCH_OFF || mBlock == Material.REDSTONE_TORCH_ON) {
    return keepAlives.contains(b) ? 15 : 0;
  }
  return b.getBlockPower();
}
Program: 83882
Project: 83882
Buggy source:
@EventHandler(priority=EventPriority.LOW) public void onBlockRedstoneChange(BlockRedstoneEvent event){
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOW) public void onBlockRedstoneChange(BlockRedstoneEvent event){
  if (CircuitManager.circuitExists(event.getBlock().getLocation())) {
    CircuitManager.activateCircuit(event.getBlock().getLocation(),event.getNewCurrent());
  }
  if (CircuitManager.shouldLeaveReceiverOn(event.getBlock())) {
    event.setNewCurrent(15);
  }
}
Program: 83887
Project: 83887
Buggy source:
public CircuitManager(final QuantumConnectors qc){
  this.plugin=qc;
}

Fixed version (ground truth):
public CircuitManager(final QuantumConnectors qc){
  this.plugin=qc;
  for (  World world : plugin.getServer().getWorlds()) {
    loadWorld(world);
  }
}
Program: 83888
Project: 83888
Buggy source:
/** 
 * ���� ���� ���´�.
 */
public void putBlock(int x,int y,Block block){
  if (0 <= x && x < WIDTH && 0 <= y && y < HEIGHT) {
    if (block.getItem().getInteract() != null) {
      interactable.add(new BlockEntry(x,y,block));
      inTime.add(new ArrayList<Float>(monsters.size()));
    }
    map[y][x]=block;
  }
}

Fixed version (ground truth):
/** 
 * ���� ���� ���´�.
 */
public void putBlock(int x,int y,Block block){
  if (0 <= x && x < WIDTH && 0 <= y && y < HEIGHT) {
    if (block.getItem().getInteract() != null) {
      interactable.add(new BlockEntry(x,y,block));
      ArrayList<Float> a=new ArrayList<Float>();
      for (int i=0; i < monsters.size(); ++i)       a.add(0f);
      inTime.add(a);
    }
    map[y][x]=block;
  }
}
Program: 83889
Project: 83889
Buggy source:
@Override public void update(float delta){
  super.update(delta);
  if (nticks++ % 30 == 0)   walkTo(player.position);
  kill();
}

Fixed version (ground truth):
@Override public void update(float delta){
  delta*=deltaMul;
  super.update(delta);
  if (nticks++ % 30 == 0)   walkTo(player.position);
  kill();
}
Program: 83890
Project: 83890
Buggy source:
@Override public void boundIn(Mob mob,int blockX,int blockY,float delta){
  mob.velocity.x=mob.WALK_SPEED * MULTIPLIER;
}

Fixed version (ground truth):
@Override public void boundIn(Mob mob,int blockX,int blockY,float delta){
  mob.setDeltaMul(MULTIPLIER);
}
Program: 83891
Project: 83891
Buggy source:
@Override public void boundOut(Mob mob,int blockX,int blockY,float delta){
  ;
}

Fixed version (ground truth):
@Override public void boundOut(Mob mob,int blockX,int blockY,float delta){
  mob.setDeltaMul(1f);
}
Program: 83892
Project: 83892
Buggy source:
public void update(float delta){
  Vector2 movevector=new Vector2(getPlayer().position.x - this.pseudoPos.x,getPlayer().position.y - this.pseudoPos.y).nor();
  this.pseudoPos.add(movevector.mul(speed * delta));
  this.position=pseudoPos.cpy();
  this.position.y+=Math.sin(totaltime * Math.PI * 2 / 1.3f) * wavingheight;
  totaltime+=delta;
  setDirection(movevector.x >= 0 ? RIGHT : LEFT);
  if (isAlive())   hit(damagePerSecondFactor * delta);
}

Fixed version (ground truth):
public void update(float delta){
  delta*=getDeltaMul();
  Vector2 movevector=new Vector2(getPlayer().position.x - this.pseudoPos.x,getPlayer().position.y - this.pseudoPos.y).nor();
  this.pseudoPos.add(movevector.mul(speed * delta));
  this.position=pseudoPos.cpy();
  this.position.y+=Math.sin(totaltime * Math.PI * 2 / 1.3f) * wavingheight;
  totaltime+=delta;
  setDirection(movevector.x >= 0 ? RIGHT : LEFT);
  if (isAlive())   hit(damagePerSecondFactor * delta);
}
Program: 83893
Project: 83893
Buggy source:
/** 
 * ���� ���� ���´�.
 */
public void putBlock(int x,int y,Block block){
  if (0 <= x && x < WIDTH && 0 <= y && y < HEIGHT) {
    if (block.getItem().getInteract() != null) {
      interactable.add(new BlockEntry(x,y,block));
      ArrayList<Float> a=new ArrayList<Float>();
      for (int i=0; i < monsters.size(); ++i)       a.add(0f);
      inTime.add(a);
    }
    map[y][x]=block;
  }
}

Fixed version (ground truth):
/** 
 * ���� ���� ���´�.
 */
public void putBlock(int x,int y,Block block){
  if (0 <= x && x < WIDTH && 0 <= y && y < HEIGHT) {
    if (block.getItem().getInteract() != null) {
      interactable.add(new BlockEntry(x,y,block));
      ArrayList<Float> a=new ArrayList<Float>(monsters.size());
      for (int i=monsters.size(); i > 0; --i)       a.add(0f);
      inTime.add(a);
    }
    map[y][x]=block;
  }
}
Program: 83895
Project: 83895
Buggy source:
/** 
 * ��������.
 */
public void climb(){
  changestate(STATE_CLIMB);
  velocity.y=CLIMB_SPEED;
}

Fixed version (ground truth):
/** 
 * ��������.
 */
public void climb(){
  changestate(STATE_CLIMB);
  position.y+=0.1;
  velocity.y=CLIMB_SPEED;
}
Program: 83896
Project: 83896
Buggy source:
/** 
 * �÷��̾ ���ϴ� ���⿡ ���� �ִ��� (�浹üũ)
 * @param xmovedist x�࿡�� ������ �Ÿ�
 * @return ������ true, ������ false
 */
private boolean blockInPath(float xmovedist){
  int blocky_bottom=(int)Math.floor(position.y);
  int blocky_top=(int)Math.floor(position.y + hitbox.height);
  int blockx1=(int)Math.floor(position.x + xmovedist + hitbox.width);
  int blockx2=(int)Math.floor(position.x + xmovedist);
  return world.getBlock(blockx1,blocky_bottom) != null || world.getBlock(blockx1,blocky_top) != null || world.getBlock(blockx2,blocky_bottom) != null || world.getBlock(blockx2,blocky_top) != null;
}

Fixed version (ground truth):
/** 
 * �÷��̾ ���ϴ� ���⿡ ���� �ִ��� (�浹üũ)
 * @param xmovedist x�࿡�� ������ �Ÿ�
 * @return ������ true, ������ false
 */
private boolean blockInPath(float xmovedist){
  int blocky_bottom=(int)Math.floor(position.y);
  int blocky_top=(int)Math.floor(position.y + hitbox.height);
  int blockx1=(int)Math.floor(position.x + xmovedist + hitbox.width);
  int blockx2=(int)Math.floor(position.x + xmovedist);
  return world.getBlock(blockx1,blocky_bottom) != null || world.getBlock(blockx1,blocky_top) != null || world.getBlock(blockx2,blocky_bottom) != null || world.getBlock(blockx2,blocky_top) != null || world.getBlock((int)(position.x + xmovedist + hitbox.width),(int)position.y + 1) != null || world.getBlock((int)position.x,(int)position.y + 1) != null;
}
Program: 83898
Project: 83898
Buggy source:
/** 
 * ��������.
 */
public void climb(){
  changestate(STATE_CLIMB);
  position.y+=0.1;
  velocity.y=CLIMB_SPEED;
}

Fixed version (ground truth):
/** 
 * ��������.
 */
public void climb(){
  changestate(STATE_CLIMB);
  velocity.y=CLIMB_SPEED;
}
Program: 83899
Project: 83899
Buggy source:
/** 
 * @deprecated Use {@link #forType(Class)} instead.
 */
public static <T>ArgumentProcessor<T> newInstance(Class<T> beanType){
  return forType(beanType);
}

Fixed version (ground truth):
/** 
 * @param beanType type of the bean.
 * @param < T > type of bean class.
 * @return instance of argument processor for given type of bean.
 * @deprecated Use {@link #forType(Class)} instead.
 */
public static <T>ArgumentProcessor<T> newInstance(Class<T> beanType){
  return forType(beanType);
}
Program: 83900
Project: 83900
Buggy source:
/** 
 * Verify if given arguments meet requirement defined for processor
 * @param arguments Array of command line arguments
 * @return
 */
public abstract ValidationResult validate(String[] arguments);

Fixed version (ground truth):
/** 
 * Verifies if given arguments meet requirement defined for processor.
 * @param arguments array of command line arguments.
 * @return a result object.
 */
public abstract ValidationResult validate(String[] arguments);
Program: 83901
Project: 83901
Buggy source:
/** 
 * @inheritDoc
 */
@Override public CommandLine parse(List<String> arguments,ParsingContext context){
  CommandLineBuilder builder=new CommandLineBuilder();
  boolean expectingOptionValue=false;
  String optionName=null;
  boolean shortOption=false;
  for (  String arg : arguments) {
    if (expectingOptionValue) {
      if (shortOption) {
        builder.withShortOption(optionName,arg);
      }
 else {
        builder.withLongOption(optionName,arg);
      }
      expectingOptionValue=false;
    }
 else     if (arg.startsWith("String_Node_Str")) {
      optionName=arg.substring(2);
      Option opt=context.optionWithLongName(optionName);
      if (opt == null) {
        builder.withArgument(arg);
      }
 else       if (opt.isFlag()) {
        builder.withLongFlag(optionName);
      }
 else {
        expectingOptionValue=true;
        shortOption=false;
      }
    }
 else     if (arg.startsWith("String_Node_Str")) {
      optionName=arg.substring(1);
      Option opt=context.optionWithShortName(optionName);
      if (opt == null) {
        builder.withArgument(arg);
      }
 else       if (opt.isFlag()) {
        builder.withShortFlag(optionName);
      }
 else {
        expectingOptionValue=true;
        shortOption=true;
      }
    }
 else {
      builder.withArgument(arg);
    }
  }
  return builder.toCommandLine();
}

Fixed version (ground truth):
@Override public CommandLine parse(List<String> arguments,ParsingContext context){
  CommandLineBuilder builder=new CommandLineBuilder();
  boolean expectingOptionValue=false;
  String optionName=null;
  boolean shortOption=false;
  for (  String arg : arguments) {
    if (expectingOptionValue) {
      if (shortOption) {
        builder.withShortOption(optionName,arg);
      }
 else {
        builder.withLongOption(optionName,arg);
      }
      expectingOptionValue=false;
    }
 else     if (arg.startsWith("String_Node_Str")) {
      optionName=arg.substring(2);
      Option opt=context.optionWithLongName(optionName);
      if (opt == null) {
        builder.withArgument(arg);
      }
 else       if (opt.isFlag()) {
        builder.withLongFlag(optionName);
      }
 else {
        expectingOptionValue=true;
        shortOption=false;
      }
    }
 else     if (arg.startsWith("String_Node_Str")) {
      optionName=arg.substring(1);
      Option opt=context.optionWithShortName(optionName);
      if (opt == null) {
        builder.withArgument(arg);
      }
 else       if (opt.isFlag()) {
        builder.withShortFlag(optionName);
      }
 else {
        expectingOptionValue=true;
        shortOption=true;
      }
    }
 else {
      builder.withArgument(arg);
    }
  }
  return builder.toCommandLine();
}
Program: 83902
Project: 83902
Buggy source:
@Inject SchedulerServiceImpl(@Assisted final int workerThreads,@Assisted final String threadNamePrefix){
  this.workerThreads=workerThreads;
  this.schedulerThreadNameFormat=threadNamePrefix + "String_Node_Str";
  this.workerThreadNameFormat=threadNamePrefix + "String_Node_Str";
}

Fixed version (ground truth):
@Inject public SchedulerServiceImpl(@Assisted final int workerThreads,@Assisted final String threadNamePrefix){
  this.workerThreads=workerThreads;
  this.schedulerThreadNameFormat=threadNamePrefix + "String_Node_Str";
  this.workerThreadNameFormat=threadNamePrefix + "String_Node_Str";
}
Program: 83903
Project: 83903
Buggy source:
@Override public void updateLastDOM(final DOMObserverListener listener,final Node updatedDOM){
  if (!listenerMap.containsKey(listener)) {
    throw new IllegalArgumentException("String_Node_Str" + listener + "String_Node_Str");
  }
  listenerMap.put(listener,updatedDOM);
}

Fixed version (ground truth):
@Override public void updateLastDOM(final DOMObserverListener listener,final Node updatedDOM){
  listenerMapLock.lock();
  try {
    if (!listenerMap.containsKey(listener)) {
      throw new IllegalArgumentException("String_Node_Str" + listener + "String_Node_Str");
    }
    listenerMap.put(listener,updatedDOM);
  }
  finally {
    listenerMapLock.unlock();
  }
}
Program: 83904
Project: 83904
Buggy source:
private void evaluateXPathExpressionAndNotify(final DOMObserverListener listener){
  String xPathExpression=listener.getXPathExpression();
  QName qName=listener.getQName();
  DOMTuple scopedChanges;
  try {
    scopedChanges=getScopedChangesInternal(xPathExpression,qName);
  }
 catch (  XPathExpressionException e) {
    notifyXPathEvaluationFailure(e);
    return;
  }
  notifyListener(listener,scopedChanges);
}

Fixed version (ground truth):
private void evaluateXPathExpressionAndNotify(final DOMObserverListener listener){
  String xPathExpression=listener.getXPathExpression();
  QName qName=listener.getQName();
  DOMTuple scopedChanges;
  try {
    scopedChanges=getScopedChangesInternal(xPathExpression,qName);
  }
 catch (  XPathExpressionException e) {
    notifyXPathEvaluationFailure(e);
    return;
  }
  if (scopedChanges != null) {
    notifyListener(listener,scopedChanges);
  }
}
Program: 83905
Project: 83905
Buggy source:
@Test public void testThatNoChangeIsDetectedWhenBotNotNullAndBothAreEqualScoped() throws Exception {
  Node node1=createDOM(CONFIG_1);
  Node node2=createDOM(CONFIG_1);
  when(nodeProviderMock.get()).thenReturn(node1).thenReturn(node2);
  domObserver.updateCurrentDOM();
  domObserver.updateCurrentDOM();
  DOMTuple lastScopedChanges=domObserver.getScopedChanges(X_PATH_EXPRESSION_APPLICATION_NODES,XPathConstants.NODESET);
  assertNull(lastScopedChanges);
}

Fixed version (ground truth):
@Test public void testThatNoChangeIsDetectedWhenBotNotNullAndBothAreEqualScoped() throws Exception {
  when(nodeProviderMock.get()).thenReturn(createDOM(CONFIG_1)).thenReturn(createDOM(CONFIG_1));
  domObserver.updateCurrentDOM();
  domObserver.updateCurrentDOM();
  DOMTuple scopedChanges=domObserver.getScopedChanges(XPATH_EXPRESSION_APPLICATION_NODES,XPathConstants.NODESET);
  assertNull(scopedChanges);
}
Program: 83906
Project: 83906
Buggy source:
@Test public void testThatChangeIsDetectedWhenBothNotNullAndChangeOccurredScoped() throws Exception {
  Node node1=createDOM(CONFIG_1);
  Node node2=createDOM(CONFIG_2);
  when(nodeProviderMock.get()).thenReturn(node1).thenReturn(node2);
  domObserver.updateCurrentDOM();
  domObserver.updateCurrentDOM();
  DOMTuple lastScopedChanges=domObserver.getScopedChanges(X_PATH_EXPRESSION_APPLICATION_NODES,XPathConstants.NODESET);
  assertNotNull(lastScopedChanges);
  assertNotNull(lastScopedChanges.getFirst());
  assertNotNull(lastScopedChanges.getSecond());
}

Fixed version (ground truth):
@Test public void testThatChangeIsDetectedWhenBothNotNullAndChangeOccurredScoped() throws Exception {
  Node node1=createDOM(CONFIG_1);
  Node node2=createDOM(CONFIG_2);
  when(nodeProviderMock.get()).thenReturn(node1).thenReturn(node2);
  domObserver.updateCurrentDOM();
  domObserver.updateCurrentDOM();
  DOMTuple lastScopedChanges=domObserver.getScopedChanges(XPATH_EXPRESSION_APPLICATION_NODES,XPathConstants.NODESET);
  assertNotNull(lastScopedChanges);
  assertNotNull(lastScopedChanges.getFirst());
  assertNotNull(lastScopedChanges.getSecond());
}
Program: 83907
Project: 83907
Buggy source:
/** 
 * Gets a named warp object from persistence
 * @param warpName the name of the warp to get
 * @param requestingPlayer the player who is requesting this warp
 * @param persistenceProvider the persistence provider implementation
 * @return a warp object
 */
public Warp getWarp(String warpName,Player requestingPlayer,IPersistenceProvider persistenceProvider){
  Warp retVal=null;
  if (warpName != null && requestingPlayer != null) {
    List<Warp> availableWarpsForUser=getAvailableWarpsForUser(requestingPlayer.getDisplayName(),requestingPlayer,persistenceProvider);
    if (warpName.contains("String_Node_Str")) {
      for (      Warp warp : availableWarpsForUser) {
        if (warp.getFullyQualifiedName().equalsIgnoreCase(warpName))         retVal=warp;
      }
    }
 else {
      List<Warp> matchingWarps=new ArrayList<Warp>();
      for (      Warp warp : availableWarpsForUser) {
        if (warp.getName().equalsIgnoreCase(warpName)) {
          matchingWarps.add(warp);
        }
      }
      if (matchingWarps.size() == 1) {
        retVal=matchingWarps.get(0);
      }
 else       if (matchingWarps.size() > 1) {
        for (        Warp warp : matchingWarps) {
          if (warp.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName()))           retVal=warp;
        }
      }
    }
  }
  return retVal;
}

Fixed version (ground truth):
/** 
 * Gets a named warp object from persistence
 * @param warpName the name of the warp to get
 * @param requestingPlayer the player who is requesting this warp
 * @param persistenceProvider the persistence provider implementation
 * @return a warp object
 */
public Warp getWarp(String warpName,Player requestingPlayer,IPersistenceProvider persistenceProvider){
  Warp retVal=null;
  if (warpName != null && requestingPlayer != null) {
    List<Warp> availableWarpsForUser=getAvailableWarpsForUser(requestingPlayer.getDisplayName(),requestingPlayer,persistenceProvider);
    if (warpName.contains(AppStrings.FQL_DELIMITER)) {
      for (      Warp warp : availableWarpsForUser) {
        if (warp.getFullyQualifiedName().equalsIgnoreCase(warpName))         retVal=warp;
      }
    }
{
      List<Warp> matchingWarps=new ArrayList<Warp>();
      for (      Warp warp : availableWarpsForUser) {
        if (warp.getName().equalsIgnoreCase(warpName)) {
          matchingWarps.add(warp);
        }
      }
      if (matchingWarps.size() == 1) {
        retVal=matchingWarps.get(0);
      }
 else       if (matchingWarps.size() > 1) {
        for (        Warp warp : matchingWarps) {
          if (warp.getOwner().equalsIgnoreCase(requestingPlayer.getDisplayName()))           retVal=warp;
        }
      }
    }
  }
  return retVal;
}