nus-yam/ex-repair huggingface dataset:
Program: 2248
Project: 2248
Buggy source:
@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  mDisconnectedReceiver=new UsbDisconnectedReceiver(this);
  Intent intent=getIntent();
  String fingerprints=intent.getStringExtra("String_Node_Str");
  mKey=intent.getStringExtra("String_Node_Str");
  if (fingerprints == null || mKey == null) {
    finish();
    return;
  }
  final AlertController.AlertParams ap=mAlertParams;
  ap.mTitle=getString(R.string.usb_debugging_title);
  ap.mIconId=com.android.internal.R.drawable.ic_dialog_usb;
  ap.mMessage=getString(R.string.usb_debugging_message,fingerprints);
  ap.mPositiveButtonText=getString(android.R.string.ok);
  ap.mNegativeButtonText=getString(android.R.string.cancel);
  ap.mPositiveButtonListener=this;
  ap.mNegativeButtonListener=this;
  LayoutInflater inflater=LayoutInflater.from(ap.mContext);
  View checkbox=inflater.inflate(com.android.internal.R.layout.always_use_checkbox,null);
  mAlwaysAllow=(CheckBox)checkbox.findViewById(com.android.internal.R.id.alwaysUse);
  mAlwaysAllow.setText(getString(R.string.usb_debugging_always));
  ap.mView=checkbox;
  setupAlert();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  if (SystemProperties.getInt("String_Node_Str",0) == 0) {
    mDisconnectedReceiver=new UsbDisconnectedReceiver(this);
  }
  Intent intent=getIntent();
  String fingerprints=intent.getStringExtra("String_Node_Str");
  mKey=intent.getStringExtra("String_Node_Str");
  if (fingerprints == null || mKey == null) {
    finish();
    return;
  }
  final AlertController.AlertParams ap=mAlertParams;
  ap.mTitle=getString(R.string.usb_debugging_title);
  ap.mIconId=com.android.internal.R.drawable.ic_dialog_usb;
  ap.mMessage=getString(R.string.usb_debugging_message,fingerprints);
  ap.mPositiveButtonText=getString(android.R.string.ok);
  ap.mNegativeButtonText=getString(android.R.string.cancel);
  ap.mPositiveButtonListener=this;
  ap.mNegativeButtonListener=this;
  LayoutInflater inflater=LayoutInflater.from(ap.mContext);
  View checkbox=inflater.inflate(com.android.internal.R.layout.always_use_checkbox,null);
  mAlwaysAllow=(CheckBox)checkbox.findViewById(com.android.internal.R.id.alwaysUse);
  mAlwaysAllow.setText(getString(R.string.usb_debugging_always));
  ap.mView=checkbox;
  setupAlert();
}
Program: 2250
Project: 2250
Buggy source:
/** 
 * See   {@link WebView#destroy()}
 */
@Override public void destroy(){
  if (mWebView.getViewRootImpl() != null) {
    Log.e(LOGTAG,"String_Node_Str");
  }
  ensureFunctorDetached();
  destroyJava();
  destroyNative();
}

Fixed version (ground truth):
/** 
 * See   {@link WebView#destroy()}
 */
@Override public void destroy(){
  if (mWebView.getViewRootImpl() != null) {
    Log.e(LOGTAG,Log.getStackTraceString(new Throwable("String_Node_Str")));
  }
  ensureFunctorDetached();
  destroyJava();
  destroyNative();
}
Program: 2251
Project: 2251
Buggy source:
/** 
 * See   {@link WebView#destroy()}
 */
@Override public void destroy(){
  if (mWebView.getViewRootImpl() != null) {
    Log.e(LOGTAG,"String_Node_Str");
  }
  ensureFunctorDetached();
  destroyJava();
  destroyNative();
}

Fixed version (ground truth):
/** 
 * See   {@link WebView#destroy()}
 */
@Override public void destroy(){
  if (mWebView.getViewRootImpl() != null) {
    Log.e(LOGTAG,Log.getStackTraceString(new Throwable("String_Node_Str")));
  }
  ensureFunctorDetached();
  destroyJava();
  destroyNative();
}
Program: 2252
Project: 2252
Buggy source:
/** 
 * See   {@link WebView#destroy()}
 */
@Override public void destroy(){
  if (mWebView.getViewRootImpl() != null) {
    Log.e(LOGTAG,"String_Node_Str");
  }
  ensureFunctorDetached();
  destroyJava();
  destroyNative();
}

Fixed version (ground truth):
/** 
 * See   {@link WebView#destroy()}
 */
@Override public void destroy(){
  if (mWebView.getViewRootImpl() != null) {
    Log.e(LOGTAG,Log.getStackTraceString(new Throwable("String_Node_Str")));
  }
  ensureFunctorDetached();
  destroyJava();
  destroyNative();
}
Program: 2253
Project: 2253
Buggy source:
private void measureChildWithMargins2(View child,int parentWidthSpec,int parentHeightSpec,int childWidth,int childHeight){
  int childWidthSpec=getChildMeasureSpec(parentWidthSpec,mPaddingLeft + mPaddingRight + getTotalMargin(child,true),childWidth);
  int childHeightSpec=getChildMeasureSpec(parentHeightSpec,mPaddingTop + mPaddingBottom + getTotalMargin(child,false),childHeight);
  child.measure(childWidthSpec,childHeightSpec);
}

Fixed version (ground truth):
private void measureChildWithMargins2(View child,int parentWidthSpec,int parentHeightSpec,int childWidth,int childHeight){
  int childWidthSpec=getChildMeasureSpec(parentWidthSpec,getTotalMargin(child,true),childWidth);
  int childHeightSpec=getChildMeasureSpec(parentHeightSpec,getTotalMargin(child,false),childHeight);
  child.measure(childWidthSpec,childHeightSpec);
}
Program: 2254
Project: 2254
Buggy source:
@Override protected void onMeasure(int widthSpec,int heightSpec){
  consistencyCheck();
  invalidateValues();
  measureChildrenWithMargins(widthSpec,heightSpec,true);
  int width, height;
  if (orientation == HORIZONTAL) {
    width=horizontalAxis.getMeasure(widthSpec);
    measureChildrenWithMargins(widthSpec,heightSpec,false);
    height=verticalAxis.getMeasure(heightSpec);
  }
 else {
    height=verticalAxis.getMeasure(heightSpec);
    measureChildrenWithMargins(widthSpec,heightSpec,false);
    width=horizontalAxis.getMeasure(widthSpec);
  }
  int hPadding=getPaddingLeft() + getPaddingRight();
  int vPadding=getPaddingTop() + getPaddingBottom();
  int measuredWidth=Math.max(hPadding + width,getSuggestedMinimumWidth());
  int measuredHeight=Math.max(vPadding + height,getSuggestedMinimumHeight());
  setMeasuredDimension(resolveSizeAndState(measuredWidth,widthSpec,0),resolveSizeAndState(measuredHeight,heightSpec,0));
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthSpec,int heightSpec){
  consistencyCheck();
  invalidateValues();
  int hPadding=getPaddingLeft() + getPaddingRight();
  int vPadding=getPaddingTop() + getPaddingBottom();
  int widthSpecSansPadding=adjust(widthSpec,-hPadding);
  int heightSpecSansPadding=adjust(heightSpec,-vPadding);
  measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,true);
  int widthSansPadding;
  int heightSansPadding;
  if (orientation == HORIZONTAL) {
    widthSansPadding=horizontalAxis.getMeasure(widthSpecSansPadding);
    measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,false);
    heightSansPadding=verticalAxis.getMeasure(heightSpecSansPadding);
  }
 else {
    heightSansPadding=verticalAxis.getMeasure(heightSpecSansPadding);
    measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,false);
    widthSansPadding=horizontalAxis.getMeasure(widthSpecSansPadding);
  }
  int measuredWidth=Math.max(widthSansPadding + hPadding,getSuggestedMinimumWidth());
  int measuredHeight=Math.max(heightSansPadding + vPadding,getSuggestedMinimumHeight());
  setMeasuredDimension(resolveSizeAndState(measuredWidth,widthSpec,0),resolveSizeAndState(measuredHeight,heightSpec,0));
}
Program: 2255
Project: 2255
Buggy source:
private void measureChildWithMargins2(View child,int parentWidthSpec,int parentHeightSpec,int childWidth,int childHeight){
  int childWidthSpec=getChildMeasureSpec(parentWidthSpec,mPaddingLeft + mPaddingRight + getTotalMargin(child,true),childWidth);
  int childHeightSpec=getChildMeasureSpec(parentHeightSpec,mPaddingTop + mPaddingBottom + getTotalMargin(child,false),childHeight);
  child.measure(childWidthSpec,childHeightSpec);
}

Fixed version (ground truth):
private void measureChildWithMargins2(View child,int parentWidthSpec,int parentHeightSpec,int childWidth,int childHeight){
  int childWidthSpec=getChildMeasureSpec(parentWidthSpec,getTotalMargin(child,true),childWidth);
  int childHeightSpec=getChildMeasureSpec(parentHeightSpec,getTotalMargin(child,false),childHeight);
  child.measure(childWidthSpec,childHeightSpec);
}
Program: 2256
Project: 2256
Buggy source:
@Override protected void onMeasure(int widthSpec,int heightSpec){
  consistencyCheck();
  invalidateValues();
  measureChildrenWithMargins(widthSpec,heightSpec,true);
  int width, height;
  if (orientation == HORIZONTAL) {
    width=horizontalAxis.getMeasure(widthSpec);
    measureChildrenWithMargins(widthSpec,heightSpec,false);
    height=verticalAxis.getMeasure(heightSpec);
  }
 else {
    height=verticalAxis.getMeasure(heightSpec);
    measureChildrenWithMargins(widthSpec,heightSpec,false);
    width=horizontalAxis.getMeasure(widthSpec);
  }
  int hPadding=getPaddingLeft() + getPaddingRight();
  int vPadding=getPaddingTop() + getPaddingBottom();
  int measuredWidth=Math.max(hPadding + width,getSuggestedMinimumWidth());
  int measuredHeight=Math.max(vPadding + height,getSuggestedMinimumHeight());
  setMeasuredDimension(resolveSizeAndState(measuredWidth,widthSpec,0),resolveSizeAndState(measuredHeight,heightSpec,0));
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthSpec,int heightSpec){
  consistencyCheck();
  invalidateValues();
  int hPadding=getPaddingLeft() + getPaddingRight();
  int vPadding=getPaddingTop() + getPaddingBottom();
  int widthSpecSansPadding=adjust(widthSpec,-hPadding);
  int heightSpecSansPadding=adjust(heightSpec,-vPadding);
  measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,true);
  int widthSansPadding;
  int heightSansPadding;
  if (orientation == HORIZONTAL) {
    widthSansPadding=horizontalAxis.getMeasure(widthSpecSansPadding);
    measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,false);
    heightSansPadding=verticalAxis.getMeasure(heightSpecSansPadding);
  }
 else {
    heightSansPadding=verticalAxis.getMeasure(heightSpecSansPadding);
    measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,false);
    widthSansPadding=horizontalAxis.getMeasure(widthSpecSansPadding);
  }
  int measuredWidth=Math.max(widthSansPadding + hPadding,getSuggestedMinimumWidth());
  int measuredHeight=Math.max(heightSansPadding + vPadding,getSuggestedMinimumHeight());
  setMeasuredDimension(resolveSizeAndState(measuredWidth,widthSpec,0),resolveSizeAndState(measuredHeight,heightSpec,0));
}
Program: 2257
Project: 2257
Buggy source:
private void measureChildWithMargins2(View child,int parentWidthSpec,int parentHeightSpec,int childWidth,int childHeight){
  int childWidthSpec=getChildMeasureSpec(parentWidthSpec,mPaddingLeft + mPaddingRight + getTotalMargin(child,true),childWidth);
  int childHeightSpec=getChildMeasureSpec(parentHeightSpec,mPaddingTop + mPaddingBottom + getTotalMargin(child,false),childHeight);
  child.measure(childWidthSpec,childHeightSpec);
}

Fixed version (ground truth):
private void measureChildWithMargins2(View child,int parentWidthSpec,int parentHeightSpec,int childWidth,int childHeight){
  int childWidthSpec=getChildMeasureSpec(parentWidthSpec,getTotalMargin(child,true),childWidth);
  int childHeightSpec=getChildMeasureSpec(parentHeightSpec,getTotalMargin(child,false),childHeight);
  child.measure(childWidthSpec,childHeightSpec);
}
Program: 2258
Project: 2258
Buggy source:
@Override protected void onMeasure(int widthSpec,int heightSpec){
  consistencyCheck();
  invalidateValues();
  measureChildrenWithMargins(widthSpec,heightSpec,true);
  int width, height;
  if (orientation == HORIZONTAL) {
    width=horizontalAxis.getMeasure(widthSpec);
    measureChildrenWithMargins(widthSpec,heightSpec,false);
    height=verticalAxis.getMeasure(heightSpec);
  }
 else {
    height=verticalAxis.getMeasure(heightSpec);
    measureChildrenWithMargins(widthSpec,heightSpec,false);
    width=horizontalAxis.getMeasure(widthSpec);
  }
  int hPadding=getPaddingLeft() + getPaddingRight();
  int vPadding=getPaddingTop() + getPaddingBottom();
  int measuredWidth=Math.max(hPadding + width,getSuggestedMinimumWidth());
  int measuredHeight=Math.max(vPadding + height,getSuggestedMinimumHeight());
  setMeasuredDimension(resolveSizeAndState(measuredWidth,widthSpec,0),resolveSizeAndState(measuredHeight,heightSpec,0));
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthSpec,int heightSpec){
  consistencyCheck();
  invalidateValues();
  int hPadding=getPaddingLeft() + getPaddingRight();
  int vPadding=getPaddingTop() + getPaddingBottom();
  int widthSpecSansPadding=adjust(widthSpec,-hPadding);
  int heightSpecSansPadding=adjust(heightSpec,-vPadding);
  measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,true);
  int widthSansPadding;
  int heightSansPadding;
  if (orientation == HORIZONTAL) {
    widthSansPadding=horizontalAxis.getMeasure(widthSpecSansPadding);
    measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,false);
    heightSansPadding=verticalAxis.getMeasure(heightSpecSansPadding);
  }
 else {
    heightSansPadding=verticalAxis.getMeasure(heightSpecSansPadding);
    measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,false);
    widthSansPadding=horizontalAxis.getMeasure(widthSpecSansPadding);
  }
  int measuredWidth=Math.max(widthSansPadding + hPadding,getSuggestedMinimumWidth());
  int measuredHeight=Math.max(heightSansPadding + vPadding,getSuggestedMinimumHeight());
  setMeasuredDimension(resolveSizeAndState(measuredWidth,widthSpec,0),resolveSizeAndState(measuredHeight,heightSpec,0));
}
Program: 2259
Project: 2259
Buggy source:
/** 
 * See   {@link WebView#destroy()}
 */
@Override public void destroy(){
  if (mWebView.getViewRootImpl() != null) {
    Log.e(LOGTAG,"String_Node_Str");
  }
  ensureFunctorDetached();
  destroyJava();
  destroyNative();
}

Fixed version (ground truth):
/** 
 * See   {@link WebView#destroy()}
 */
@Override public void destroy(){
  if (mWebView.getViewRootImpl() != null) {
    Log.e(LOGTAG,Log.getStackTraceString(new Throwable("String_Node_Str")));
  }
  ensureFunctorDetached();
  destroyJava();
  destroyNative();
}
Program: 2261
Project: 2261
Buggy source:
public void setState(int state){
switch (state) {
case STATE_NONE:
    mHandler.removeCallbacks(mScrollFade);
  mList.invalidate();
break;
case STATE_VISIBLE:
if (mState != STATE_VISIBLE) {
resetThumbPos();
}
case STATE_DRAGGING:
mHandler.removeCallbacks(mScrollFade);
break;
case STATE_EXIT:
int viewWidth=mList.getWidth();
mList.invalidate(viewWidth - mThumbW,mThumbY,viewWidth,mThumbY + mThumbH);
break;
}
mState=state;
refreshDrawableState();
}

Fixed version (ground truth):
public void setState(int state){
switch (state) {
case STATE_NONE:
    mHandler.removeCallbacks(mScrollFade);
  mList.invalidate();
break;
case STATE_VISIBLE:
if (mState != STATE_VISIBLE) {
resetThumbPos();
}
case STATE_DRAGGING:
mHandler.removeCallbacks(mScrollFade);
break;
case STATE_EXIT:
final int viewWidth=mList.getWidth();
final int top=mThumbY;
final int bottom=mThumbY + mThumbH;
final int left;
final int right;
switch (mList.getLayoutDirection()) {
case View.LAYOUT_DIRECTION_RTL:
left=0;
right=mThumbW;
break;
case View.LAYOUT_DIRECTION_LTR:
default :
left=viewWidth - mThumbW;
right=viewWidth;
}
mList.invalidate(left,top,right,bottom);
break;
}
mState=state;
refreshDrawableState();
}
Program: 2262
Project: 2262
Buggy source:
private void measureChildWithMargins2(View child,int parentWidthSpec,int parentHeightSpec,int childWidth,int childHeight){
  int childWidthSpec=getChildMeasureSpec(parentWidthSpec,mPaddingLeft + mPaddingRight + getTotalMargin(child,true),childWidth);
  int childHeightSpec=getChildMeasureSpec(parentHeightSpec,mPaddingTop + mPaddingBottom + getTotalMargin(child,false),childHeight);
  child.measure(childWidthSpec,childHeightSpec);
}

Fixed version (ground truth):
private void measureChildWithMargins2(View child,int parentWidthSpec,int parentHeightSpec,int childWidth,int childHeight){
  int childWidthSpec=getChildMeasureSpec(parentWidthSpec,getTotalMargin(child,true),childWidth);
  int childHeightSpec=getChildMeasureSpec(parentHeightSpec,getTotalMargin(child,false),childHeight);
  child.measure(childWidthSpec,childHeightSpec);
}
Program: 2263
Project: 2263
Buggy source:
@Override protected void onMeasure(int widthSpec,int heightSpec){
  consistencyCheck();
  invalidateValues();
  measureChildrenWithMargins(widthSpec,heightSpec,true);
  int width, height;
  if (orientation == HORIZONTAL) {
    width=horizontalAxis.getMeasure(widthSpec);
    measureChildrenWithMargins(widthSpec,heightSpec,false);
    height=verticalAxis.getMeasure(heightSpec);
  }
 else {
    height=verticalAxis.getMeasure(heightSpec);
    measureChildrenWithMargins(widthSpec,heightSpec,false);
    width=horizontalAxis.getMeasure(widthSpec);
  }
  int hPadding=getPaddingLeft() + getPaddingRight();
  int vPadding=getPaddingTop() + getPaddingBottom();
  int measuredWidth=Math.max(hPadding + width,getSuggestedMinimumWidth());
  int measuredHeight=Math.max(vPadding + height,getSuggestedMinimumHeight());
  setMeasuredDimension(resolveSizeAndState(measuredWidth,widthSpec,0),resolveSizeAndState(measuredHeight,heightSpec,0));
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthSpec,int heightSpec){
  consistencyCheck();
  invalidateValues();
  int hPadding=getPaddingLeft() + getPaddingRight();
  int vPadding=getPaddingTop() + getPaddingBottom();
  int widthSpecSansPadding=adjust(widthSpec,-hPadding);
  int heightSpecSansPadding=adjust(heightSpec,-vPadding);
  measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,true);
  int widthSansPadding;
  int heightSansPadding;
  if (orientation == HORIZONTAL) {
    widthSansPadding=horizontalAxis.getMeasure(widthSpecSansPadding);
    measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,false);
    heightSansPadding=verticalAxis.getMeasure(heightSpecSansPadding);
  }
 else {
    heightSansPadding=verticalAxis.getMeasure(heightSpecSansPadding);
    measureChildrenWithMargins(widthSpecSansPadding,heightSpecSansPadding,false);
    widthSansPadding=horizontalAxis.getMeasure(widthSpecSansPadding);
  }
  int measuredWidth=Math.max(widthSansPadding + hPadding,getSuggestedMinimumWidth());
  int measuredHeight=Math.max(heightSansPadding + vPadding,getSuggestedMinimumHeight());
  setMeasuredDimension(resolveSizeAndState(measuredWidth,widthSpec,0),resolveSizeAndState(measuredHeight,heightSpec,0));
}
Program: 2265
Project: 2265
Buggy source:
public void setState(int state){
switch (state) {
case STATE_NONE:
    mHandler.removeCallbacks(mScrollFade);
  mList.invalidate();
break;
case STATE_VISIBLE:
if (mState != STATE_VISIBLE) {
resetThumbPos();
}
case STATE_DRAGGING:
mHandler.removeCallbacks(mScrollFade);
break;
case STATE_EXIT:
int viewWidth=mList.getWidth();
mList.invalidate(viewWidth - mThumbW,mThumbY,viewWidth,mThumbY + mThumbH);
break;
}
mState=state;
refreshDrawableState();
}

Fixed version (ground truth):
public void setState(int state){
switch (state) {
case STATE_NONE:
    mHandler.removeCallbacks(mScrollFade);
  mList.invalidate();
break;
case STATE_VISIBLE:
if (mState != STATE_VISIBLE) {
resetThumbPos();
}
case STATE_DRAGGING:
mHandler.removeCallbacks(mScrollFade);
break;
case STATE_EXIT:
final int viewWidth=mList.getWidth();
final int top=mThumbY;
final int bottom=mThumbY + mThumbH;
final int left;
final int right;
switch (mList.getLayoutDirection()) {
case View.LAYOUT_DIRECTION_RTL:
left=0;
right=mThumbW;
break;
case View.LAYOUT_DIRECTION_LTR:
default :
left=viewWidth - mThumbW;
right=viewWidth;
}
mList.invalidate(left,top,right,bottom);
break;
}
mState=state;
refreshDrawableState();
}
Program: 2267
Project: 2267
Buggy source:
public void setState(int state){
switch (state) {
case STATE_NONE:
    mHandler.removeCallbacks(mScrollFade);
  mList.invalidate();
break;
case STATE_VISIBLE:
if (mState != STATE_VISIBLE) {
resetThumbPos();
}
case STATE_DRAGGING:
mHandler.removeCallbacks(mScrollFade);
break;
case STATE_EXIT:
int viewWidth=mList.getWidth();
mList.invalidate(viewWidth - mThumbW,mThumbY,viewWidth,mThumbY + mThumbH);
break;
}
mState=state;
refreshDrawableState();
}

Fixed version (ground truth):
public void setState(int state){
switch (state) {
case STATE_NONE:
    mHandler.removeCallbacks(mScrollFade);
  mList.invalidate();
break;
case STATE_VISIBLE:
if (mState != STATE_VISIBLE) {
resetThumbPos();
}
case STATE_DRAGGING:
mHandler.removeCallbacks(mScrollFade);
break;
case STATE_EXIT:
final int viewWidth=mList.getWidth();
final int top=mThumbY;
final int bottom=mThumbY + mThumbH;
final int left;
final int right;
switch (mList.getLayoutDirection()) {
case View.LAYOUT_DIRECTION_RTL:
left=0;
right=mThumbW;
break;
case View.LAYOUT_DIRECTION_LTR:
default :
left=viewWidth - mThumbW;
right=viewWidth;
}
mList.invalidate(left,top,right,bottom);
break;
}
mState=state;
refreshDrawableState();
}
Program: 2269
Project: 2269
Buggy source:
public void setState(int state){
switch (state) {
case STATE_NONE:
    mHandler.removeCallbacks(mScrollFade);
  mList.invalidate();
break;
case STATE_VISIBLE:
if (mState != STATE_VISIBLE) {
resetThumbPos();
}
case STATE_DRAGGING:
mHandler.removeCallbacks(mScrollFade);
break;
case STATE_EXIT:
int viewWidth=mList.getWidth();
mList.invalidate(viewWidth - mThumbW,mThumbY,viewWidth,mThumbY + mThumbH);
break;
}
mState=state;
refreshDrawableState();
}

Fixed version (ground truth):
public void setState(int state){
switch (state) {
case STATE_NONE:
    mHandler.removeCallbacks(mScrollFade);
  mList.invalidate();
break;
case STATE_VISIBLE:
if (mState != STATE_VISIBLE) {
resetThumbPos();
}
case STATE_DRAGGING:
mHandler.removeCallbacks(mScrollFade);
break;
case STATE_EXIT:
final int viewWidth=mList.getWidth();
final int top=mThumbY;
final int bottom=mThumbY + mThumbH;
final int left;
final int right;
switch (mList.getLayoutDirection()) {
case View.LAYOUT_DIRECTION_RTL:
left=0;
right=mThumbW;
break;
case View.LAYOUT_DIRECTION_LTR:
default :
left=viewWidth - mThumbW;
right=viewWidth;
}
mList.invalidate(left,top,right,bottom);
break;
}
mState=state;
refreshDrawableState();
}
Program: 2270
Project: 2270
Buggy source:
public boolean onJsConfirm(String url,String message){
  if (mWebChromeClient == null) {
    return false;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message confirm=obtainMessage(JS_CONFIRM,result);
  confirm.getData().putString("String_Node_Str",message);
  confirm.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(confirm);
  return result.mJsResult.getResult();
}

Fixed version (ground truth):
public boolean onJsConfirm(String url,String message){
  if (mWebChromeClient == null) {
    return false;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message confirm=obtainMessage(JS_DIALOG,result);
  confirm.getData().putString("String_Node_Str",message);
  confirm.getData().putString("String_Node_Str",url);
  confirm.getData().putInt("String_Node_Str",JsDialogHelper.CONFIRM);
  sendMessageToUiThreadSync(confirm);
  return result.mJsResult.getResult();
}
Program: 2271
Project: 2271
Buggy source:
public void onJsAlert(String url,String message){
  if (mWebChromeClient == null) {
    return;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message alert=obtainMessage(JS_ALERT,result);
  alert.getData().putString("String_Node_Str",message);
  alert.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(alert);
}

Fixed version (ground truth):
public void onJsAlert(String url,String message){
  if (mWebChromeClient == null) {
    return;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message alert=obtainMessage(JS_DIALOG,result);
  alert.getData().putString("String_Node_Str",message);
  alert.getData().putString("String_Node_Str",url);
  alert.getData().putInt("String_Node_Str",JsDialogHelper.ALERT);
  sendMessageToUiThreadSync(alert);
}
Program: 2272
Project: 2272
Buggy source:
public String onJsPrompt(String url,String message,String defaultValue){
  if (mWebChromeClient == null) {
    return null;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message prompt=obtainMessage(JS_PROMPT,result);
  prompt.getData().putString("String_Node_Str",message);
  prompt.getData().putString("String_Node_Str",defaultValue);
  prompt.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(prompt);
  return result.mJsResult.getStringResult();
}

Fixed version (ground truth):
public String onJsPrompt(String url,String message,String defaultValue){
  if (mWebChromeClient == null) {
    return null;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message prompt=obtainMessage(JS_DIALOG,result);
  prompt.getData().putString("String_Node_Str",message);
  prompt.getData().putString("String_Node_Str",defaultValue);
  prompt.getData().putString("String_Node_Str",url);
  prompt.getData().putInt("String_Node_Str",JsDialogHelper.PROMPT);
  sendMessageToUiThreadSync(prompt);
  return result.mJsResult.getStringResult();
}
Program: 2273
Project: 2273
Buggy source:
public boolean onJsBeforeUnload(String url,String message){
  if (mWebChromeClient == null) {
    return true;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message confirm=obtainMessage(JS_UNLOAD,result);
  confirm.getData().putString("String_Node_Str",message);
  confirm.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(confirm);
  return result.mJsResult.getResult();
}

Fixed version (ground truth):
public boolean onJsBeforeUnload(String url,String message){
  if (mWebChromeClient == null) {
    return true;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message unload=obtainMessage(JS_DIALOG,result);
  unload.getData().putString("String_Node_Str",message);
  unload.getData().putString("String_Node_Str",url);
  unload.getData().putInt("String_Node_Str",JsDialogHelper.UNLOAD);
  sendMessageToUiThreadSync(unload);
  return result.mJsResult.getResult();
}
Program: 2275
Project: 2275
Buggy source:
@Override public void addTestProvider(String name,ProviderProperties properties){
  checkMockPermissionsSafe();
  if (LocationManager.PASSIVE_PROVIDER.equals(name)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  long identity=Binder.clearCallingIdentity();
synchronized (mLock) {
    MockProvider provider=new MockProvider(name,this,properties);
    if (LocationManager.GPS_PROVIDER.equals(name) || LocationManager.NETWORK_PROVIDER.equals(name) || LocationManager.FUSED_PROVIDER.equals(name)) {
      LocationProviderInterface p=mProvidersByName.get(name);
      if (p != null) {
        removeProviderLocked(p);
      }
    }
    if (mProvidersByName.get(name) != null) {
      throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
    }
    addProviderLocked(provider);
    mMockProviders.put(name,provider);
    mLastLocation.put(name,null);
    updateProvidersLocked();
  }
  Binder.restoreCallingIdentity(identity);
}

Fixed version (ground truth):
@Override public void addTestProvider(String name,ProviderProperties properties){
  checkMockPermissionsSafe();
  if (LocationManager.PASSIVE_PROVIDER.equals(name)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  long identity=Binder.clearCallingIdentity();
synchronized (mLock) {
    MockProvider provider=new MockProvider(name,this,properties);
    if (LocationManager.GPS_PROVIDER.equals(name) || LocationManager.NETWORK_PROVIDER.equals(name) || LocationManager.FUSED_PROVIDER.equals(name)) {
      LocationProviderInterface p=mProvidersByName.get(name);
      if (p != null) {
        removeProviderLocked(p);
      }
    }
    if (mProvidersByName.get(name) != null) {
      throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
    }
    addProviderLocked(provider);
    mMockProviders.put(name,provider);
    mLastLocation.put(name,null);
    mLastLocationCoarseInterval.put(name,null);
    updateProvidersLocked();
  }
  Binder.restoreCallingIdentity(identity);
}
Program: 2277
Project: 2277
Buggy source:
/** 
 * Called when the device's active user changes.
 * @param userId the new active user's UserId
 */
private void switchUser(int userId){
  mBlacklist.switchUser(userId);
  mLocationHandler.removeMessages(MSG_LOCATION_CHANGED);
synchronized (mLock) {
    mLastLocation.clear();
    for (    LocationProviderInterface p : mProviders) {
      updateProviderListenersLocked(p.getName(),false,mCurrentUserId);
    }
    mCurrentUserId=userId;
    updateProvidersLocked();
  }
}

Fixed version (ground truth):
/** 
 * Called when the device's active user changes.
 * @param userId the new active user's UserId
 */
private void switchUser(int userId){
  mBlacklist.switchUser(userId);
  mLocationHandler.removeMessages(MSG_LOCATION_CHANGED);
synchronized (mLock) {
    mLastLocation.clear();
    mLastLocationCoarseInterval.clear();
    for (    LocationProviderInterface p : mProviders) {
      updateProviderListenersLocked(p.getName(),false,mCurrentUserId);
    }
    mCurrentUserId=userId;
    updateProvidersLocked();
  }
}
Program: 2280
Project: 2280
Buggy source:
@Override public void removeTestProvider(String provider){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider mockProvider=mMockProviders.remove(provider);
    if (mockProvider == null) {
      throw new IllegalArgumentException("String_Node_Str" + provider + "String_Node_Str");
    }
    long identity=Binder.clearCallingIdentity();
    removeProviderLocked(mProvidersByName.get(provider));
    LocationProviderInterface realProvider=mRealProviders.get(provider);
    if (realProvider != null) {
      addProviderLocked(realProvider);
    }
    mLastLocation.put(provider,null);
    updateProvidersLocked();
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void removeTestProvider(String provider){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider mockProvider=mMockProviders.remove(provider);
    if (mockProvider == null) {
      throw new IllegalArgumentException("String_Node_Str" + provider + "String_Node_Str");
    }
    long identity=Binder.clearCallingIdentity();
    removeProviderLocked(mProvidersByName.get(provider));
    LocationProviderInterface realProvider=mRealProviders.get(provider);
    if (realProvider != null) {
      addProviderLocked(realProvider);
    }
    mLastLocation.put(provider,null);
    mLastLocationCoarseInterval.put(provider,null);
    updateProvidersLocked();
    Binder.restoreCallingIdentity(identity);
  }
}
Program: 2281
Project: 2281
Buggy source:
private static boolean shouldBroadcastSafe(Location loc,Location lastLoc,UpdateRecord record,long now){
  if (lastLoc == null) {
    return true;
  }
  long minTime=record.mRequest.getFastestInterval();
  long delta=(loc.getElapsedRealtimeNanos() - lastLoc.getElapsedRealtimeNanos()) / 1000000L;
  if (delta < minTime - MAX_PROVIDER_SCHEDULING_JITTER_MS) {
    return false;
  }
  double minDistance=record.mRequest.getSmallestDisplacement();
  if (minDistance > 0.0) {
    if (loc.distanceTo(lastLoc) <= minDistance) {
      return false;
    }
  }
  if (record.mRequest.getNumUpdates() <= 0) {
    return false;
  }
  if (record.mRequest.getExpireAt() < now) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private static boolean shouldBroadcastSafe(Location loc,Location lastLoc,UpdateRecord record,long now){
  if (lastLoc == null) {
    return true;
  }
  long minTime=record.mRequest.getFastestInterval();
  long delta=(loc.getElapsedRealtimeNanos() - lastLoc.getElapsedRealtimeNanos()) / NANOS_PER_MILLI;
  if (delta < minTime - MAX_PROVIDER_SCHEDULING_JITTER_MS) {
    return false;
  }
  double minDistance=record.mRequest.getSmallestDisplacement();
  if (minDistance > 0.0) {
    if (loc.distanceTo(lastLoc) <= minDistance) {
      return false;
    }
  }
  if (record.mRequest.getNumUpdates() <= 0) {
    return false;
  }
  if (record.mRequest.getExpireAt() < now) {
    return false;
  }
  return true;
}
Program: 2283
Project: 2283
Buggy source:
/** 
 * Return whether this window is wanting to have a translation animation applied to it for an in-progress move.  (Only makes sense to call from performLayoutAndPlaceSurfacesLockedInner().)
 */
boolean shouldAnimateMove(){
  return mContentChanged && !mExiting && !mWinAnimator.mLastHidden&& mService.okToDisplay()&& (mFrame.top != mLastFrame.top || mFrame.left != mLastFrame.left)&& (mAttachedWindow == null || !mAttachedWindow.shouldAnimateMove());
}

Fixed version (ground truth):
/** 
 * Return whether this window is wanting to have a translation animation applied to it for an in-progress move.  (Only makes sense to call from performLayoutAndPlaceSurfacesLockedInner().)
 */
boolean shouldAnimateMove(){
  return mContentChanged && !mExiting && !mWinAnimator.mLastHidden&& mService.okToDisplay()&& (mFrame.top != mLastFrame.top || mFrame.left != mLastFrame.left)&& (mAttrs.privateFlags & PRIVATE_FLAG_NO_MOVE_ANIMATION) == 0 && (mAttachedWindow == null || !mAttachedWindow.shouldAnimateMove());
}
Program: 2284
Project: 2284
Buggy source:
public boolean onJsConfirm(String url,String message){
  if (mWebChromeClient == null) {
    return false;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message confirm=obtainMessage(JS_CONFIRM,result);
  confirm.getData().putString("String_Node_Str",message);
  confirm.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(confirm);
  return result.mJsResult.getResult();
}

Fixed version (ground truth):
public boolean onJsConfirm(String url,String message){
  if (mWebChromeClient == null) {
    return false;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message confirm=obtainMessage(JS_DIALOG,result);
  confirm.getData().putString("String_Node_Str",message);
  confirm.getData().putString("String_Node_Str",url);
  confirm.getData().putInt("String_Node_Str",JsDialogHelper.CONFIRM);
  sendMessageToUiThreadSync(confirm);
  return result.mJsResult.getResult();
}
Program: 2285
Project: 2285
Buggy source:
public void onJsAlert(String url,String message){
  if (mWebChromeClient == null) {
    return;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message alert=obtainMessage(JS_ALERT,result);
  alert.getData().putString("String_Node_Str",message);
  alert.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(alert);
}

Fixed version (ground truth):
public void onJsAlert(String url,String message){
  if (mWebChromeClient == null) {
    return;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message alert=obtainMessage(JS_DIALOG,result);
  alert.getData().putString("String_Node_Str",message);
  alert.getData().putString("String_Node_Str",url);
  alert.getData().putInt("String_Node_Str",JsDialogHelper.ALERT);
  sendMessageToUiThreadSync(alert);
}
Program: 2286
Project: 2286
Buggy source:
public String onJsPrompt(String url,String message,String defaultValue){
  if (mWebChromeClient == null) {
    return null;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message prompt=obtainMessage(JS_PROMPT,result);
  prompt.getData().putString("String_Node_Str",message);
  prompt.getData().putString("String_Node_Str",defaultValue);
  prompt.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(prompt);
  return result.mJsResult.getStringResult();
}

Fixed version (ground truth):
public String onJsPrompt(String url,String message,String defaultValue){
  if (mWebChromeClient == null) {
    return null;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message prompt=obtainMessage(JS_DIALOG,result);
  prompt.getData().putString("String_Node_Str",message);
  prompt.getData().putString("String_Node_Str",defaultValue);
  prompt.getData().putString("String_Node_Str",url);
  prompt.getData().putInt("String_Node_Str",JsDialogHelper.PROMPT);
  sendMessageToUiThreadSync(prompt);
  return result.mJsResult.getStringResult();
}
Program: 2287
Project: 2287
Buggy source:
public boolean onJsBeforeUnload(String url,String message){
  if (mWebChromeClient == null) {
    return true;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message confirm=obtainMessage(JS_UNLOAD,result);
  confirm.getData().putString("String_Node_Str",message);
  confirm.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(confirm);
  return result.mJsResult.getResult();
}

Fixed version (ground truth):
public boolean onJsBeforeUnload(String url,String message){
  if (mWebChromeClient == null) {
    return true;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message unload=obtainMessage(JS_DIALOG,result);
  unload.getData().putString("String_Node_Str",message);
  unload.getData().putString("String_Node_Str",url);
  unload.getData().putInt("String_Node_Str",JsDialogHelper.UNLOAD);
  sendMessageToUiThreadSync(unload);
  return result.mJsResult.getResult();
}
Program: 2289
Project: 2289
Buggy source:
public boolean onJsConfirm(String url,String message){
  if (mWebChromeClient == null) {
    return false;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message confirm=obtainMessage(JS_CONFIRM,result);
  confirm.getData().putString("String_Node_Str",message);
  confirm.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(confirm);
  return result.mJsResult.getResult();
}

Fixed version (ground truth):
public boolean onJsConfirm(String url,String message){
  if (mWebChromeClient == null) {
    return false;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message confirm=obtainMessage(JS_DIALOG,result);
  confirm.getData().putString("String_Node_Str",message);
  confirm.getData().putString("String_Node_Str",url);
  confirm.getData().putInt("String_Node_Str",JsDialogHelper.CONFIRM);
  sendMessageToUiThreadSync(confirm);
  return result.mJsResult.getResult();
}
Program: 2290
Project: 2290
Buggy source:
public void onJsAlert(String url,String message){
  if (mWebChromeClient == null) {
    return;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message alert=obtainMessage(JS_ALERT,result);
  alert.getData().putString("String_Node_Str",message);
  alert.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(alert);
}

Fixed version (ground truth):
public void onJsAlert(String url,String message){
  if (mWebChromeClient == null) {
    return;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message alert=obtainMessage(JS_DIALOG,result);
  alert.getData().putString("String_Node_Str",message);
  alert.getData().putString("String_Node_Str",url);
  alert.getData().putInt("String_Node_Str",JsDialogHelper.ALERT);
  sendMessageToUiThreadSync(alert);
}
Program: 2291
Project: 2291
Buggy source:
public String onJsPrompt(String url,String message,String defaultValue){
  if (mWebChromeClient == null) {
    return null;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message prompt=obtainMessage(JS_PROMPT,result);
  prompt.getData().putString("String_Node_Str",message);
  prompt.getData().putString("String_Node_Str",defaultValue);
  prompt.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(prompt);
  return result.mJsResult.getStringResult();
}

Fixed version (ground truth):
public String onJsPrompt(String url,String message,String defaultValue){
  if (mWebChromeClient == null) {
    return null;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message prompt=obtainMessage(JS_DIALOG,result);
  prompt.getData().putString("String_Node_Str",message);
  prompt.getData().putString("String_Node_Str",defaultValue);
  prompt.getData().putString("String_Node_Str",url);
  prompt.getData().putInt("String_Node_Str",JsDialogHelper.PROMPT);
  sendMessageToUiThreadSync(prompt);
  return result.mJsResult.getStringResult();
}
Program: 2292
Project: 2292
Buggy source:
public boolean onJsBeforeUnload(String url,String message){
  if (mWebChromeClient == null) {
    return true;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message confirm=obtainMessage(JS_UNLOAD,result);
  confirm.getData().putString("String_Node_Str",message);
  confirm.getData().putString("String_Node_Str",url);
  sendMessageToUiThreadSync(confirm);
  return result.mJsResult.getResult();
}

Fixed version (ground truth):
public boolean onJsBeforeUnload(String url,String message){
  if (mWebChromeClient == null) {
    return true;
  }
  JsResultReceiver result=new JsResultReceiver();
  Message unload=obtainMessage(JS_DIALOG,result);
  unload.getData().putString("String_Node_Str",message);
  unload.getData().putString("String_Node_Str",url);
  unload.getData().putInt("String_Node_Str",JsDialogHelper.UNLOAD);
  sendMessageToUiThreadSync(unload);
  return result.mJsResult.getResult();
}
Program: 2294
Project: 2294
Buggy source:
@Override public void addTestProvider(String name,ProviderProperties properties){
  checkMockPermissionsSafe();
  if (LocationManager.PASSIVE_PROVIDER.equals(name)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  long identity=Binder.clearCallingIdentity();
synchronized (mLock) {
    MockProvider provider=new MockProvider(name,this,properties);
    if (LocationManager.GPS_PROVIDER.equals(name) || LocationManager.NETWORK_PROVIDER.equals(name) || LocationManager.FUSED_PROVIDER.equals(name)) {
      LocationProviderInterface p=mProvidersByName.get(name);
      if (p != null) {
        removeProviderLocked(p);
      }
    }
    if (mProvidersByName.get(name) != null) {
      throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
    }
    addProviderLocked(provider);
    mMockProviders.put(name,provider);
    mLastLocation.put(name,null);
    updateProvidersLocked();
  }
  Binder.restoreCallingIdentity(identity);
}

Fixed version (ground truth):
@Override public void addTestProvider(String name,ProviderProperties properties){
  checkMockPermissionsSafe();
  if (LocationManager.PASSIVE_PROVIDER.equals(name)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  long identity=Binder.clearCallingIdentity();
synchronized (mLock) {
    MockProvider provider=new MockProvider(name,this,properties);
    if (LocationManager.GPS_PROVIDER.equals(name) || LocationManager.NETWORK_PROVIDER.equals(name) || LocationManager.FUSED_PROVIDER.equals(name)) {
      LocationProviderInterface p=mProvidersByName.get(name);
      if (p != null) {
        removeProviderLocked(p);
      }
    }
    if (mProvidersByName.get(name) != null) {
      throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
    }
    addProviderLocked(provider);
    mMockProviders.put(name,provider);
    mLastLocation.put(name,null);
    mLastLocationCoarseInterval.put(name,null);
    updateProvidersLocked();
  }
  Binder.restoreCallingIdentity(identity);
}
Program: 2296
Project: 2296
Buggy source:
/** 
 * Called when the device's active user changes.
 * @param userId the new active user's UserId
 */
private void switchUser(int userId){
  mBlacklist.switchUser(userId);
  mLocationHandler.removeMessages(MSG_LOCATION_CHANGED);
synchronized (mLock) {
    mLastLocation.clear();
    for (    LocationProviderInterface p : mProviders) {
      updateProviderListenersLocked(p.getName(),false,mCurrentUserId);
    }
    mCurrentUserId=userId;
    updateProvidersLocked();
  }
}

Fixed version (ground truth):
/** 
 * Called when the device's active user changes.
 * @param userId the new active user's UserId
 */
private void switchUser(int userId){
  mBlacklist.switchUser(userId);
  mLocationHandler.removeMessages(MSG_LOCATION_CHANGED);
synchronized (mLock) {
    mLastLocation.clear();
    mLastLocationCoarseInterval.clear();
    for (    LocationProviderInterface p : mProviders) {
      updateProviderListenersLocked(p.getName(),false,mCurrentUserId);
    }
    mCurrentUserId=userId;
    updateProvidersLocked();
  }
}
Program: 2299
Project: 2299
Buggy source:
@Override public void removeTestProvider(String provider){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider mockProvider=mMockProviders.remove(provider);
    if (mockProvider == null) {
      throw new IllegalArgumentException("String_Node_Str" + provider + "String_Node_Str");
    }
    long identity=Binder.clearCallingIdentity();
    removeProviderLocked(mProvidersByName.get(provider));
    LocationProviderInterface realProvider=mRealProviders.get(provider);
    if (realProvider != null) {
      addProviderLocked(realProvider);
    }
    mLastLocation.put(provider,null);
    updateProvidersLocked();
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void removeTestProvider(String provider){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider mockProvider=mMockProviders.remove(provider);
    if (mockProvider == null) {
      throw new IllegalArgumentException("String_Node_Str" + provider + "String_Node_Str");
    }
    long identity=Binder.clearCallingIdentity();
    removeProviderLocked(mProvidersByName.get(provider));
    LocationProviderInterface realProvider=mRealProviders.get(provider);
    if (realProvider != null) {
      addProviderLocked(realProvider);
    }
    mLastLocation.put(provider,null);
    mLastLocationCoarseInterval.put(provider,null);
    updateProvidersLocked();
    Binder.restoreCallingIdentity(identity);
  }
}
Program: 2300
Project: 2300
Buggy source:
private static boolean shouldBroadcastSafe(Location loc,Location lastLoc,UpdateRecord record,long now){
  if (lastLoc == null) {
    return true;
  }
  long minTime=record.mRequest.getFastestInterval();
  long delta=(loc.getElapsedRealtimeNanos() - lastLoc.getElapsedRealtimeNanos()) / 1000000L;
  if (delta < minTime - MAX_PROVIDER_SCHEDULING_JITTER_MS) {
    return false;
  }
  double minDistance=record.mRequest.getSmallestDisplacement();
  if (minDistance > 0.0) {
    if (loc.distanceTo(lastLoc) <= minDistance) {
      return false;
    }
  }
  if (record.mRequest.getNumUpdates() <= 0) {
    return false;
  }
  if (record.mRequest.getExpireAt() < now) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private static boolean shouldBroadcastSafe(Location loc,Location lastLoc,UpdateRecord record,long now){
  if (lastLoc == null) {
    return true;
  }
  long minTime=record.mRequest.getFastestInterval();
  long delta=(loc.getElapsedRealtimeNanos() - lastLoc.getElapsedRealtimeNanos()) / NANOS_PER_MILLI;
  if (delta < minTime - MAX_PROVIDER_SCHEDULING_JITTER_MS) {
    return false;
  }
  double minDistance=record.mRequest.getSmallestDisplacement();
  if (minDistance > 0.0) {
    if (loc.distanceTo(lastLoc) <= minDistance) {
      return false;
    }
  }
  if (record.mRequest.getNumUpdates() <= 0) {
    return false;
  }
  if (record.mRequest.getExpireAt() < now) {
    return false;
  }
  return true;
}
Program: 2302
Project: 2302
Buggy source:
/** 
 * Return whether this window is wanting to have a translation animation applied to it for an in-progress move.  (Only makes sense to call from performLayoutAndPlaceSurfacesLockedInner().)
 */
boolean shouldAnimateMove(){
  return mContentChanged && !mExiting && !mWinAnimator.mLastHidden&& mService.okToDisplay()&& (mFrame.top != mLastFrame.top || mFrame.left != mLastFrame.left)&& (mAttachedWindow == null || !mAttachedWindow.shouldAnimateMove());
}

Fixed version (ground truth):
/** 
 * Return whether this window is wanting to have a translation animation applied to it for an in-progress move.  (Only makes sense to call from performLayoutAndPlaceSurfacesLockedInner().)
 */
boolean shouldAnimateMove(){
  return mContentChanged && !mExiting && !mWinAnimator.mLastHidden&& mService.okToDisplay()&& (mFrame.top != mLastFrame.top || mFrame.left != mLastFrame.left)&& (mAttrs.privateFlags & PRIVATE_FLAG_NO_MOVE_ANIMATION) == 0 && (mAttachedWindow == null || !mAttachedWindow.shouldAnimateMove());
}