nus-yam/ex-repair huggingface dataset:
Program: 199082
Project: 199082
Buggy source:
@Override public void handleMessage(Message message){
  Object listener=null;
switch (message.what) {
case AsyncChannel.CMD_CHANNEL_DISCONNECTED:
    if (mChannelListener != null) {
      mChannelListener.onChannelDisconnected();
      mChannelListener=null;
    }
  break;
case REQUEST_ANQP_INFO_SUCCEEDED:
WifiPasspointInfo result=(WifiPasspointInfo)message.obj;
anqpRequestFinish(result);
listener=getListener(message.arg2,false);
if (listener != null) {
((ActionListener)listener).onSuccess();
}
break;
case REQUEST_ANQP_INFO_FAILED:
anqpRequestFinish((ScanResult)message.obj);
listener=getListener(message.arg2,false);
if (listener == null) getListener(message.arg2,true);
if (listener != null) {
((ActionListener)listener).onFailure(message.arg1);
}
break;
case START_OSU_SUCCEEDED:
listener=getListener(message.arg2,true);
if (listener != null) {
((OsuRemListener)listener).onSuccess();
}
break;
case START_OSU_FAILED:
listener=getListener(message.arg2,true);
if (listener != null) {
((OsuRemListener)listener).onFailure(message.arg1);
}
break;
case START_OSU_BROWSER:
listener=getListener(message.arg2,true);
if (listener != null) {
ParcelableString str=(ParcelableString)message.obj;
if (str.string == null) ((OsuRemListener)listener).onBrowserDismiss();
 else ((OsuRemListener)listener).onBrowserLaunch(str.string);
}
break;
default :
Log.d(TAG,"String_Node_Str" + message);
break;
}
}

Fixed version (ground truth):
@Override public void handleMessage(Message message){
  Object listener=null;
switch (message.what) {
case AsyncChannel.CMD_CHANNEL_DISCONNECTED:
    if (mChannelListener != null) {
      mChannelListener.onChannelDisconnected();
      mChannelListener=null;
    }
  break;
case REQUEST_ANQP_INFO_SUCCEEDED:
WifiPasspointInfo result=(WifiPasspointInfo)message.obj;
anqpRequestFinish(result);
listener=getListener(message.arg2,false);
if (listener != null) {
((ActionListener)listener).onSuccess();
}
break;
case REQUEST_ANQP_INFO_FAILED:
anqpRequestFinish((ScanResult)message.obj);
listener=getListener(message.arg2,false);
if (listener == null) getListener(message.arg2,true);
if (listener != null) {
((ActionListener)listener).onFailure(message.arg1);
}
break;
case START_OSU_SUCCEEDED:
listener=getListener(message.arg2,true);
if (listener != null) {
((OsuRemListener)listener).onSuccess();
}
break;
case START_OSU_FAILED:
listener=getListener(message.arg2,true);
if (listener != null) {
((OsuRemListener)listener).onFailure(message.arg1);
}
break;
case START_OSU_BROWSER:
listener=getListener(message.arg2,true);
if (listener != null) {
ParcelableString str=(ParcelableString)message.obj;
if (str == null || str.string == null) ((OsuRemListener)listener).onBrowserDismiss();
 else ((OsuRemListener)listener).onBrowserLaunch(str.string);
}
break;
default :
Log.d(TAG,"String_Node_Str" + message);
break;
}
}
Program: 199083
Project: 199083
Buggy source:
/** 
 * Fling the scroll view
 * @param velocityY The initial velocity in the Y direction. Positivenumbers mean that the finger/cursor is moving down the screen, which means we want to scroll towards the top.
 */
private void fling(int velocityY){
  if (getChildCount() > 0) {
    int scrollRange=getScrollRange();
    float topAmount=getCurrentOverScrollAmount(true);
    float bottomAmount=getCurrentOverScrollAmount(false);
    if (velocityY < 0 && topAmount > 0) {
      mOwnScrollY-=(int)topAmount;
      mDontReportNextOverScroll=true;
      setOverScrollAmount(0,true,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * getRubberBandFactor() * mOverflingDistance + topAmount;
    }
 else     if (velocityY > 0 && bottomAmount > 0) {
      mOwnScrollY+=bottomAmount;
      setOverScrollAmount(0,false,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * getRubberBandFactor() * mOverflingDistance + bottomAmount;
    }
 else {
      mMaxOverScroll=0.0f;
    }
    mScroller.fling(mScrollX,mOwnScrollY,1,velocityY,0,0,0,Math.max(0,scrollRange),0,Integer.MAX_VALUE / 2);
    postInvalidateOnAnimation();
  }
}

Fixed version (ground truth):
/** 
 * Fling the scroll view
 * @param velocityY The initial velocity in the Y direction. Positivenumbers mean that the finger/cursor is moving down the screen, which means we want to scroll towards the top.
 */
private void fling(int velocityY){
  if (getChildCount() > 0) {
    int scrollRange=getScrollRange();
    float topAmount=getCurrentOverScrollAmount(true);
    float bottomAmount=getCurrentOverScrollAmount(false);
    if (velocityY < 0 && topAmount > 0) {
      mOwnScrollY-=(int)topAmount;
      mDontReportNextOverScroll=true;
      setOverScrollAmount(0,true,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * getRubberBandFactor(true) * mOverflingDistance + topAmount;
    }
 else     if (velocityY > 0 && bottomAmount > 0) {
      mOwnScrollY+=bottomAmount;
      setOverScrollAmount(0,false,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * getRubberBandFactor(false) * mOverflingDistance + bottomAmount;
    }
 else {
      mMaxOverScroll=0.0f;
    }
    mScroller.fling(mScrollX,mOwnScrollY,1,velocityY,0,0,0,Math.max(0,scrollRange),0,Integer.MAX_VALUE / 2);
    postInvalidateOnAnimation();
  }
}
Program: 199084
Project: 199084
Buggy source:
private void setOverScrollAmountInternal(float amount,boolean onTop,boolean animate){
  amount=Math.max(0,amount);
  if (animate) {
    mStateAnimator.animateOverScrollToAmount(amount,onTop);
  }
 else {
    setOverScrolledPixels(amount / getRubberBandFactor(),onTop);
    mAmbientState.setOverScrollAmount(amount,onTop);
    if (onTop) {
      notifyOverscrollTopListener(amount);
    }
    requestChildrenUpdate();
  }
}

Fixed version (ground truth):
private void setOverScrollAmountInternal(float amount,boolean onTop,boolean animate){
  amount=Math.max(0,amount);
  if (animate) {
    mStateAnimator.animateOverScrollToAmount(amount,onTop);
  }
 else {
    setOverScrolledPixels(amount / getRubberBandFactor(onTop),onTop);
    mAmbientState.setOverScrollAmount(amount,onTop);
    if (onTop) {
      notifyOverscrollTopListener(amount);
    }
    requestChildrenUpdate();
  }
}
Program: 199085
Project: 199085
Buggy source:
private float getRubberBandFactor(){
  if (mExpandedInThisMotion) {
    return RUBBER_BAND_FACTOR_AFTER_EXPAND;
  }
 else   if (mIsExpansionChanging) {
    return RUBBER_BAND_FACTOR_ON_PANEL_EXPAND;
  }
 else   if (mScrolledToTopOnFirstDown) {
    return 1.0f;
  }
  return RUBBER_BAND_FACTOR_NORMAL;
}

Fixed version (ground truth):
private float getRubberBandFactor(boolean onTop){
  if (!onTop) {
    return RUBBER_BAND_FACTOR_NORMAL;
  }
  if (mExpandedInThisMotion) {
    return RUBBER_BAND_FACTOR_AFTER_EXPAND;
  }
 else   if (mIsExpansionChanging) {
    return RUBBER_BAND_FACTOR_ON_PANEL_EXPAND;
  }
 else   if (mScrolledToTopOnFirstDown) {
    return 1.0f;
  }
  return RUBBER_BAND_FACTOR_NORMAL;
}
Program: 199086
Project: 199086
Buggy source:
public int getCallingUidLocked(){
  return mCallingUid;
}

Fixed version (ground truth):
public Integer getCallingUidLocked(){
  return mCallingUid;
}
Program: 199087
Project: 199087
Buggy source:
/** 
 * Release the specified hardware.
 */
public void releaseHardware(int deviceId,ITvInputHardware hardware,int callingUid,int resolvedUserId){
synchronized (mLock) {
    Connection connection=mConnections.get(deviceId);
    if (connection == null) {
      Slog.e(TAG,"String_Node_Str" + deviceId);
      return;
    }
    if (connection.getHardwareLocked() != hardware || connection.getCallingUidLocked() != callingUid || connection.getResolvedUserIdLocked() != resolvedUserId) {
      return;
    }
    connection.resetLocked(null,null,null,null);
  }
}

Fixed version (ground truth):
/** 
 * Release the specified hardware.
 */
public void releaseHardware(int deviceId,ITvInputHardware hardware,int callingUid,int resolvedUserId){
synchronized (mLock) {
    Connection connection=mConnections.get(deviceId);
    if (connection == null) {
      Slog.e(TAG,"String_Node_Str" + deviceId);
      return;
    }
    if (connection.getHardwareLocked() != hardware || checkUidChangedLocked(connection,callingUid,resolvedUserId)) {
      return;
    }
    connection.resetLocked(null,null,null,null);
  }
}
Program: 199088
Project: 199088
Buggy source:
public int getResolvedUserIdLocked(){
  return mResolvedUserId;
}

Fixed version (ground truth):
public Integer getResolvedUserIdLocked(){
  return mResolvedUserId;
}
Program: 199089
Project: 199089
Buggy source:
/** 
 * Create a TvInputHardware object with a specific deviceId. One service at a time can access the object, and if more than one process attempts to create hardware with the same deviceId, the latest service will get the object and all the other hardware are released. The release is notified via ITvInputHardwareCallback.onReleased().
 */
public ITvInputHardware acquireHardware(int deviceId,ITvInputHardwareCallback callback,int callingUid,int resolvedUserId){
  if (callback == null) {
    throw new NullPointerException();
  }
synchronized (mLock) {
    Connection connection=mConnections.get(deviceId);
    if (connection == null) {
      Slog.e(TAG,"String_Node_Str" + deviceId);
      return null;
    }
    if (connection.getCallingUidLocked() != callingUid || connection.getResolvedUserIdLocked() != resolvedUserId) {
      TvInputHardwareImpl hardware=new TvInputHardwareImpl(connection.getInfoLocked());
      try {
        callback.asBinder().linkToDeath(connection,0);
      }
 catch (      RemoteException e) {
        hardware.release();
        return null;
      }
      connection.resetLocked(hardware,callback,callingUid,resolvedUserId);
    }
    return connection.getHardwareLocked();
  }
}

Fixed version (ground truth):
/** 
 * Create a TvInputHardware object with a specific deviceId. One service at a time can access the object, and if more than one process attempts to create hardware with the same deviceId, the latest service will get the object and all the other hardware are released. The release is notified via ITvInputHardwareCallback.onReleased().
 */
public ITvInputHardware acquireHardware(int deviceId,ITvInputHardwareCallback callback,int callingUid,int resolvedUserId){
  if (callback == null) {
    throw new NullPointerException();
  }
synchronized (mLock) {
    Connection connection=mConnections.get(deviceId);
    if (connection == null) {
      Slog.e(TAG,"String_Node_Str" + deviceId);
      return null;
    }
    if (checkUidChangedLocked(connection,callingUid,resolvedUserId)) {
      TvInputHardwareImpl hardware=new TvInputHardwareImpl(connection.getInfoLocked());
      try {
        callback.asBinder().linkToDeath(connection,0);
      }
 catch (      RemoteException e) {
        hardware.release();
        return null;
      }
      connection.resetLocked(hardware,callback,callingUid,resolvedUserId);
    }
    return connection.getHardwareLocked();
  }
}
Program: 199090
Project: 199090
Buggy source:
public int getCallingUidLocked(){
  return mCallingUid;
}

Fixed version (ground truth):
public Integer getCallingUidLocked(){
  return mCallingUid;
}
Program: 199091
Project: 199091
Buggy source:
/** 
 * Release the specified hardware.
 */
public void releaseHardware(int deviceId,ITvInputHardware hardware,int callingUid,int resolvedUserId){
synchronized (mLock) {
    Connection connection=mConnections.get(deviceId);
    if (connection == null) {
      Slog.e(TAG,"String_Node_Str" + deviceId);
      return;
    }
    if (connection.getHardwareLocked() != hardware || connection.getCallingUidLocked() != callingUid || connection.getResolvedUserIdLocked() != resolvedUserId) {
      return;
    }
    connection.resetLocked(null,null,null,null);
  }
}

Fixed version (ground truth):
/** 
 * Release the specified hardware.
 */
public void releaseHardware(int deviceId,ITvInputHardware hardware,int callingUid,int resolvedUserId){
synchronized (mLock) {
    Connection connection=mConnections.get(deviceId);
    if (connection == null) {
      Slog.e(TAG,"String_Node_Str" + deviceId);
      return;
    }
    if (connection.getHardwareLocked() != hardware || checkUidChangedLocked(connection,callingUid,resolvedUserId)) {
      return;
    }
    connection.resetLocked(null,null,null,null);
  }
}
Program: 199092
Project: 199092
Buggy source:
public int getResolvedUserIdLocked(){
  return mResolvedUserId;
}

Fixed version (ground truth):
public Integer getResolvedUserIdLocked(){
  return mResolvedUserId;
}
Program: 199093
Project: 199093
Buggy source:
/** 
 * Create a TvInputHardware object with a specific deviceId. One service at a time can access the object, and if more than one process attempts to create hardware with the same deviceId, the latest service will get the object and all the other hardware are released. The release is notified via ITvInputHardwareCallback.onReleased().
 */
public ITvInputHardware acquireHardware(int deviceId,ITvInputHardwareCallback callback,int callingUid,int resolvedUserId){
  if (callback == null) {
    throw new NullPointerException();
  }
synchronized (mLock) {
    Connection connection=mConnections.get(deviceId);
    if (connection == null) {
      Slog.e(TAG,"String_Node_Str" + deviceId);
      return null;
    }
    if (connection.getCallingUidLocked() != callingUid || connection.getResolvedUserIdLocked() != resolvedUserId) {
      TvInputHardwareImpl hardware=new TvInputHardwareImpl(connection.getInfoLocked());
      try {
        callback.asBinder().linkToDeath(connection,0);
      }
 catch (      RemoteException e) {
        hardware.release();
        return null;
      }
      connection.resetLocked(hardware,callback,callingUid,resolvedUserId);
    }
    return connection.getHardwareLocked();
  }
}

Fixed version (ground truth):
/** 
 * Create a TvInputHardware object with a specific deviceId. One service at a time can access the object, and if more than one process attempts to create hardware with the same deviceId, the latest service will get the object and all the other hardware are released. The release is notified via ITvInputHardwareCallback.onReleased().
 */
public ITvInputHardware acquireHardware(int deviceId,ITvInputHardwareCallback callback,int callingUid,int resolvedUserId){
  if (callback == null) {
    throw new NullPointerException();
  }
synchronized (mLock) {
    Connection connection=mConnections.get(deviceId);
    if (connection == null) {
      Slog.e(TAG,"String_Node_Str" + deviceId);
      return null;
    }
    if (checkUidChangedLocked(connection,callingUid,resolvedUserId)) {
      TvInputHardwareImpl hardware=new TvInputHardwareImpl(connection.getInfoLocked());
      try {
        callback.asBinder().linkToDeath(connection,0);
      }
 catch (      RemoteException e) {
        hardware.release();
        return null;
      }
      connection.resetLocked(hardware,callback,callingUid,resolvedUserId);
    }
    return connection.getHardwareLocked();
  }
}
Program: 199094
Project: 199094
Buggy source:
/** 
 * Fling the scroll view
 * @param velocityY The initial velocity in the Y direction. Positivenumbers mean that the finger/cursor is moving down the screen, which means we want to scroll towards the top.
 */
private void fling(int velocityY){
  if (getChildCount() > 0) {
    int scrollRange=getScrollRange();
    float topAmount=getCurrentOverScrollAmount(true);
    float bottomAmount=getCurrentOverScrollAmount(false);
    if (velocityY < 0 && topAmount > 0) {
      mOwnScrollY-=(int)topAmount;
      mDontReportNextOverScroll=true;
      setOverScrollAmount(0,true,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * getRubberBandFactor() * mOverflingDistance + topAmount;
    }
 else     if (velocityY > 0 && bottomAmount > 0) {
      mOwnScrollY+=bottomAmount;
      setOverScrollAmount(0,false,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * getRubberBandFactor() * mOverflingDistance + bottomAmount;
    }
 else {
      mMaxOverScroll=0.0f;
    }
    mScroller.fling(mScrollX,mOwnScrollY,1,velocityY,0,0,0,Math.max(0,scrollRange),0,Integer.MAX_VALUE / 2);
    postInvalidateOnAnimation();
  }
}

Fixed version (ground truth):
/** 
 * Fling the scroll view
 * @param velocityY The initial velocity in the Y direction. Positivenumbers mean that the finger/cursor is moving down the screen, which means we want to scroll towards the top.
 */
private void fling(int velocityY){
  if (getChildCount() > 0) {
    int scrollRange=getScrollRange();
    float topAmount=getCurrentOverScrollAmount(true);
    float bottomAmount=getCurrentOverScrollAmount(false);
    if (velocityY < 0 && topAmount > 0) {
      mOwnScrollY-=(int)topAmount;
      mDontReportNextOverScroll=true;
      setOverScrollAmount(0,true,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * getRubberBandFactor(true) * mOverflingDistance + topAmount;
    }
 else     if (velocityY > 0 && bottomAmount > 0) {
      mOwnScrollY+=bottomAmount;
      setOverScrollAmount(0,false,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * getRubberBandFactor(false) * mOverflingDistance + bottomAmount;
    }
 else {
      mMaxOverScroll=0.0f;
    }
    mScroller.fling(mScrollX,mOwnScrollY,1,velocityY,0,0,0,Math.max(0,scrollRange),0,Integer.MAX_VALUE / 2);
    postInvalidateOnAnimation();
  }
}
Program: 199095
Project: 199095
Buggy source:
private void setOverScrollAmountInternal(float amount,boolean onTop,boolean animate){
  amount=Math.max(0,amount);
  if (animate) {
    mStateAnimator.animateOverScrollToAmount(amount,onTop);
  }
 else {
    setOverScrolledPixels(amount / getRubberBandFactor(),onTop);
    mAmbientState.setOverScrollAmount(amount,onTop);
    if (onTop) {
      notifyOverscrollTopListener(amount);
    }
    requestChildrenUpdate();
  }
}

Fixed version (ground truth):
private void setOverScrollAmountInternal(float amount,boolean onTop,boolean animate){
  amount=Math.max(0,amount);
  if (animate) {
    mStateAnimator.animateOverScrollToAmount(amount,onTop);
  }
 else {
    setOverScrolledPixels(amount / getRubberBandFactor(onTop),onTop);
    mAmbientState.setOverScrollAmount(amount,onTop);
    if (onTop) {
      notifyOverscrollTopListener(amount);
    }
    requestChildrenUpdate();
  }
}
Program: 199096
Project: 199096
Buggy source:
private float getRubberBandFactor(){
  if (mExpandedInThisMotion) {
    return RUBBER_BAND_FACTOR_AFTER_EXPAND;
  }
 else   if (mIsExpansionChanging) {
    return RUBBER_BAND_FACTOR_ON_PANEL_EXPAND;
  }
 else   if (mScrolledToTopOnFirstDown) {
    return 1.0f;
  }
  return RUBBER_BAND_FACTOR_NORMAL;
}

Fixed version (ground truth):
private float getRubberBandFactor(boolean onTop){
  if (!onTop) {
    return RUBBER_BAND_FACTOR_NORMAL;
  }
  if (mExpandedInThisMotion) {
    return RUBBER_BAND_FACTOR_AFTER_EXPAND;
  }
 else   if (mIsExpansionChanging) {
    return RUBBER_BAND_FACTOR_ON_PANEL_EXPAND;
  }
 else   if (mScrolledToTopOnFirstDown) {
    return 1.0f;
  }
  return RUBBER_BAND_FACTOR_NORMAL;
}
Program: 199099
Project: 199099
Buggy source:
@Override protected boolean isScrolledToBottom(){
  if (!isInSettings()) {
    return mNotificationStackScroller.isScrolledToBottom();
  }
  return super.isScrolledToBottom();
}

Fixed version (ground truth):
@Override protected boolean isScrolledToBottom(){
  if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    return true;
  }
  if (!isInSettings()) {
    return mNotificationStackScroller.isScrolledToBottom();
  }
  return super.isScrolledToBottom();
}
Program: 199100
Project: 199100
Buggy source:
@Override protected boolean isScrolledToBottom(){
  if (!isInSettings()) {
    return mNotificationStackScroller.isScrolledToBottom();
  }
  return super.isScrolledToBottom();
}

Fixed version (ground truth):
@Override protected boolean isScrolledToBottom(){
  if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    return true;
  }
  if (!isInSettings()) {
    return mNotificationStackScroller.isScrolledToBottom();
  }
  return super.isScrolledToBottom();
}
Program: 199101
Project: 199101
Buggy source:
@Override public void onDisplayAdded(int displayId){
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_ADDED,displayId,0));
}

Fixed version (ground truth):
@Override public void onDisplayAdded(int displayId){
  Slog.v(TAG,"String_Node_Str" + displayId);
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_ADDED,displayId,0));
}
Program: 199102
Project: 199102
Buggy source:
@Override public void release(){
synchronized (mService) {
    if (mContainerState == CONTAINER_STATE_FINISHING) {
      return;
    }
    mContainerState=CONTAINER_STATE_FINISHING;
    final Message msg=mHandler.obtainMessage(CONTAINER_TASK_LIST_EMPTY_TIMEOUT,this);
    mHandler.sendMessageDelayed(msg,1000);
    mStack.finishAllActivitiesLocked();
  }
}

Fixed version (ground truth):
@Override public void release(){
synchronized (mService) {
    if (mContainerState == CONTAINER_STATE_FINISHING) {
      return;
    }
    mContainerState=CONTAINER_STATE_FINISHING;
    final Message msg=mHandler.obtainMessage(CONTAINER_TASK_LIST_EMPTY_TIMEOUT,this);
    mHandler.sendMessageDelayed(msg,1000);
    long origId=Binder.clearCallingIdentity();
    try {
      mStack.finishAllActivitiesLocked();
    }
  finally {
      Binder.restoreCallingIdentity(origId);
    }
  }
}
Program: 199103
Project: 199103
Buggy source:
@Override public void onDisplayRemoved(int displayId){
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_REMOVED,displayId,0));
}

Fixed version (ground truth):
@Override public void onDisplayRemoved(int displayId){
  Slog.v(TAG,"String_Node_Str" + displayId);
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_REMOVED,displayId,0));
}
Program: 199104
Project: 199104
Buggy source:
@Override public void onDisplayChanged(int displayId){
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_CHANGED,displayId,0));
}

Fixed version (ground truth):
@Override public void onDisplayChanged(int displayId){
  Slog.v(TAG,"String_Node_Str" + displayId);
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_CHANGED,displayId,0));
}
Program: 199105
Project: 199105
Buggy source:
public DisplayContent getDisplayContent(){
  return mAppToken == null ? mDisplayContent : getStack().getDisplayContent();
}

Fixed version (ground truth):
public DisplayContent getDisplayContent(){
  if (mAppToken == null) {
    return mDisplayContent;
  }
  final TaskStack stack=getStack();
  return stack == null ? mDisplayContent : stack.getDisplayContent();
}
Program: 199106
Project: 199106
Buggy source:
@Override public void onDisplayAdded(int displayId){
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_ADDED,displayId,0));
}

Fixed version (ground truth):
@Override public void onDisplayAdded(int displayId){
  Slog.v(TAG,"String_Node_Str" + displayId);
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_ADDED,displayId,0));
}
Program: 199107
Project: 199107
Buggy source:
@Override public void release(){
synchronized (mService) {
    if (mContainerState == CONTAINER_STATE_FINISHING) {
      return;
    }
    mContainerState=CONTAINER_STATE_FINISHING;
    final Message msg=mHandler.obtainMessage(CONTAINER_TASK_LIST_EMPTY_TIMEOUT,this);
    mHandler.sendMessageDelayed(msg,1000);
    mStack.finishAllActivitiesLocked();
  }
}

Fixed version (ground truth):
@Override public void release(){
synchronized (mService) {
    if (mContainerState == CONTAINER_STATE_FINISHING) {
      return;
    }
    mContainerState=CONTAINER_STATE_FINISHING;
    final Message msg=mHandler.obtainMessage(CONTAINER_TASK_LIST_EMPTY_TIMEOUT,this);
    mHandler.sendMessageDelayed(msg,1000);
    long origId=Binder.clearCallingIdentity();
    try {
      mStack.finishAllActivitiesLocked();
    }
  finally {
      Binder.restoreCallingIdentity(origId);
    }
  }
}
Program: 199108
Project: 199108
Buggy source:
@Override public void onDisplayRemoved(int displayId){
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_REMOVED,displayId,0));
}

Fixed version (ground truth):
@Override public void onDisplayRemoved(int displayId){
  Slog.v(TAG,"String_Node_Str" + displayId);
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_REMOVED,displayId,0));
}
Program: 199109
Project: 199109
Buggy source:
@Override public void onDisplayChanged(int displayId){
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_CHANGED,displayId,0));
}

Fixed version (ground truth):
@Override public void onDisplayChanged(int displayId){
  Slog.v(TAG,"String_Node_Str" + displayId);
  mHandler.sendMessage(mHandler.obtainMessage(HANDLE_DISPLAY_CHANGED,displayId,0));
}
Program: 199110
Project: 199110
Buggy source:
public DisplayContent getDisplayContent(){
  return mAppToken == null ? mDisplayContent : getStack().getDisplayContent();
}

Fixed version (ground truth):
public DisplayContent getDisplayContent(){
  if (mAppToken == null) {
    return mDisplayContent;
  }
  final TaskStack stack=getStack();
  return stack == null ? mDisplayContent : stack.getDisplayContent();
}
Program: 199111
Project: 199111
Buggy source:
/** 
 * Updates each of the task animation rects. 
 */
void updateAnimationRects(){
  if (mServiceIsBound && mBootCompleted) {
    Resources res=mContext.getResources();
    int statusBarHeight=res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
    int navBarHeight=res.getDimensionPixelSize(com.android.internal.R.dimen.navigation_bar_height);
    Rect rect=new Rect();
    WindowManager wm=(WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
    wm.getDefaultDisplay().getRectSize(rect);
    try {
      Bundle data=new Bundle();
      data.putParcelable(KEY_WINDOW_RECT,rect);
      data.putParcelable(KEY_SYSTEM_INSETS,new Rect(0,statusBarHeight,0,0));
      Message msg=Message.obtain(null,MSG_UPDATE_FOR_CONFIGURATION,0,0);
      msg.setData(data);
      msg.replyTo=mMessenger;
      mService.send(msg);
    }
 catch (    RemoteException re) {
      re.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates each of the task animation rects. 
 */
void updateAnimationRects(){
  if (mServiceIsBound) {
    Resources res=mContext.getResources();
    int statusBarHeight=res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
    int navBarHeight=res.getDimensionPixelSize(com.android.internal.R.dimen.navigation_bar_height);
    Rect rect=new Rect();
    WindowManager wm=(WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
    wm.getDefaultDisplay().getRectSize(rect);
    try {
      Bundle data=new Bundle();
      data.putParcelable(KEY_WINDOW_RECT,rect);
      data.putParcelable(KEY_SYSTEM_INSETS,new Rect(0,statusBarHeight,0,0));
      Message msg=Message.obtain(null,MSG_UPDATE_FOR_CONFIGURATION,0,0);
      msg.setData(data);
      msg.replyTo=mMessenger;
      mService.send(msg);
    }
 catch (    RemoteException re) {
      re.printStackTrace();
    }
  }
}
Program: 199112
Project: 199112
Buggy source:
/** 
 * Compares this RouteInfo object against the specified object and indicates if they are equal.
 * @return {@code true} if the objects are equal, {@code false} otherwise.
 */
public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!(obj instanceof RouteInfo))   return false;
  RouteInfo target=(RouteInfo)obj;
  return Objects.equals(mDestination,target.getDestination()) && Objects.equals(mGateway,target.getGateway()) && Objects.equals(mInterface,target.getInterface());
}

Fixed version (ground truth):
/** 
 * Compares this RouteInfo object against the specified object and indicates if they are equal.
 * @return {@code true} if the objects are equal, {@code false} otherwise.
 */
public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!(obj instanceof RouteInfo))   return false;
  RouteInfo target=(RouteInfo)obj;
  return Objects.equals(mDestination,target.getDestinationLinkAddress()) && Objects.equals(mGateway,target.getGateway()) && Objects.equals(mInterface,target.getInterface());
}
Program: 199113
Project: 199113
Buggy source:
/** 
 * Updates each of the task animation rects. 
 */
void updateAnimationRects(){
  if (mServiceIsBound && mBootCompleted) {
    Resources res=mContext.getResources();
    int statusBarHeight=res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
    int navBarHeight=res.getDimensionPixelSize(com.android.internal.R.dimen.navigation_bar_height);
    Rect rect=new Rect();
    WindowManager wm=(WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
    wm.getDefaultDisplay().getRectSize(rect);
    try {
      Bundle data=new Bundle();
      data.putParcelable(KEY_WINDOW_RECT,rect);
      data.putParcelable(KEY_SYSTEM_INSETS,new Rect(0,statusBarHeight,0,0));
      Message msg=Message.obtain(null,MSG_UPDATE_FOR_CONFIGURATION,0,0);
      msg.setData(data);
      msg.replyTo=mMessenger;
      mService.send(msg);
    }
 catch (    RemoteException re) {
      re.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates each of the task animation rects. 
 */
void updateAnimationRects(){
  if (mServiceIsBound) {
    Resources res=mContext.getResources();
    int statusBarHeight=res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
    int navBarHeight=res.getDimensionPixelSize(com.android.internal.R.dimen.navigation_bar_height);
    Rect rect=new Rect();
    WindowManager wm=(WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
    wm.getDefaultDisplay().getRectSize(rect);
    try {
      Bundle data=new Bundle();
      data.putParcelable(KEY_WINDOW_RECT,rect);
      data.putParcelable(KEY_SYSTEM_INSETS,new Rect(0,statusBarHeight,0,0));
      Message msg=Message.obtain(null,MSG_UPDATE_FOR_CONFIGURATION,0,0);
      msg.setData(data);
      msg.replyTo=mMessenger;
      mService.send(msg);
    }
 catch (    RemoteException re) {
      re.printStackTrace();
    }
  }
}
Program: 199115
Project: 199115
Buggy source:
@VisibleForTesting public void onReceiveInternal(Intent intent){
  final String action=intent.getAction();
  if (Intent.ACTION_BATTERY_LOW.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=false;
  }
 else   if (Intent.ACTION_BATTERY_OKAY.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=true;
    maybeReportNewChargingState();
  }
 else   if (Intent.ACTION_POWER_CONNECTED.equals(action)) {
    mAlarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,SystemClock.elapsedRealtime() + STABLE_CHARGING_THRESHOLD_MILLIS,mStableChargingTriggerIntent);
    mCharging=true;
  }
 else   if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) {
    mAlarm.cancel(mStableChargingTriggerIntent);
    mCharging=false;
    maybeReportNewChargingState();
  }
 else   if (ACTION_CHARGING_STABLE.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    if (mCharging) {
      maybeReportNewChargingState();
    }
  }
}

Fixed version (ground truth):
@VisibleForTesting public void onReceiveInternal(Intent intent){
  final String action=intent.getAction();
  if (Intent.ACTION_BATTERY_LOW.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=false;
  }
 else   if (Intent.ACTION_BATTERY_OKAY.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=true;
    maybeReportNewChargingState();
  }
 else   if (Intent.ACTION_POWER_CONNECTED.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + STABLE_CHARGING_THRESHOLD_MILLIS);
    }
    mAlarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,SystemClock.elapsedRealtime() + STABLE_CHARGING_THRESHOLD_MILLIS,mStableChargingTriggerIntent);
    mCharging=true;
  }
 else   if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str");
    }
    mAlarm.cancel(mStableChargingTriggerIntent);
    mCharging=false;
    maybeReportNewChargingState();
  }
 else   if (ACTION_CHARGING_STABLE.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime() + "String_Node_Str"+ mCharging);
    }
    if (mCharging) {
      maybeReportNewChargingState();
    }
  }
}
Program: 199116
Project: 199116
Buggy source:
public ChargingTracker(){
  mAlarm=(AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
  Intent intent=new Intent(ACTION_CHARGING_STABLE).setComponent(new ComponentName(mContext,this.getClass()));
  mStableChargingTriggerIntent=PendingIntent.getBroadcast(mContext,0,intent,0);
}

Fixed version (ground truth):
public ChargingTracker(){
  mAlarm=(AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
  Intent intent=new Intent(ACTION_CHARGING_STABLE);
  mStableChargingTriggerIntent=PendingIntent.getBroadcast(mContext,0,intent,0);
}
Program: 199117
Project: 199117
Buggy source:
private void maybeReportNewChargingState(){
  final boolean stablePower=mChargeTracker.isOnStablePower();
  boolean reportChange=false;
synchronized (mTrackedTasks) {
    for (    JobStatus ts : mTrackedTasks) {
      boolean previous=ts.chargingConstraintSatisfied.getAndSet(stablePower);
      if (previous != stablePower) {
        reportChange=true;
      }
    }
  }
  if (reportChange) {
    mStateChangedListener.onControllerStateChanged();
  }
}

Fixed version (ground truth):
private void maybeReportNewChargingState(){
  final boolean stablePower=mChargeTracker.isOnStablePower();
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + stablePower);
  }
  boolean reportChange=false;
synchronized (mTrackedTasks) {
    for (    JobStatus ts : mTrackedTasks) {
      boolean previous=ts.chargingConstraintSatisfied.getAndSet(stablePower);
      if (previous != stablePower) {
        reportChange=true;
      }
    }
  }
  if (reportChange) {
    mStateChangedListener.onControllerStateChanged();
  }
}
Program: 199118
Project: 199118
Buggy source:
public void startTracking(){
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_BATTERY_LOW);
  filter.addAction(Intent.ACTION_BATTERY_OKAY);
  filter.addAction(Intent.ACTION_POWER_CONNECTED);
  filter.addAction(Intent.ACTION_POWER_DISCONNECTED);
  mContext.registerReceiver(this,filter);
  BatteryService batteryService=(BatteryService)ServiceManager.getService("String_Node_Str");
  if (batteryService != null) {
    mBatteryHealthy=!batteryService.getBatteryLevelLow();
    mCharging=batteryService.isPowered(BatteryManager.BATTERY_PLUGGED_ANY);
  }
 else {
  }
}

Fixed version (ground truth):
public void startTracking(){
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_BATTERY_LOW);
  filter.addAction(Intent.ACTION_BATTERY_OKAY);
  filter.addAction(Intent.ACTION_POWER_CONNECTED);
  filter.addAction(Intent.ACTION_POWER_DISCONNECTED);
  filter.addAction(ACTION_CHARGING_STABLE);
  mContext.registerReceiver(this,filter);
  BatteryService batteryService=(BatteryService)ServiceManager.getService("String_Node_Str");
  if (batteryService != null) {
    mBatteryHealthy=!batteryService.getBatteryLevelLow();
    mCharging=batteryService.isPowered(BatteryManager.BATTERY_PLUGGED_ANY);
  }
 else {
  }
}
Program: 199119
Project: 199119
Buggy source:
@Override public void dumpControllerState(PrintWriter pw){
}

Fixed version (ground truth):
@Override public void dumpControllerState(PrintWriter pw){
  pw.println("String_Node_Str");
  pw.println("String_Node_Str" + mChargeTracker.isOnStablePower());
synchronized (mTrackedTasks) {
    Iterator<JobStatus> it=mTrackedTasks.iterator();
    if (it.hasNext()) {
      pw.print(String.valueOf(it.next().hashCode()));
    }
    while (it.hasNext()) {
      pw.print("String_Node_Str" + String.valueOf(it.next().hashCode()));
    }
    pw.println();
  }
}
Program: 199120
Project: 199120
Buggy source:
@Override public void maybeStartTrackingJob(JobStatus taskStatus){
  if (taskStatus.hasChargingConstraint()) {
synchronized (mTrackedTasks) {
      mTrackedTasks.add(taskStatus);
      taskStatus.chargingConstraintSatisfied.set(mChargeTracker.isOnStablePower());
    }
  }
}

Fixed version (ground truth):
@Override public void maybeStartTrackingJob(JobStatus taskStatus){
  if (taskStatus.hasChargingConstraint()) {
    final boolean isOnStablePower=mChargeTracker.isOnStablePower();
synchronized (mTrackedTasks) {
      mTrackedTasks.add(taskStatus);
      taskStatus.chargingConstraintSatisfied.set(isOnStablePower);
    }
    if (isOnStablePower) {
      mStateChangedListener.onControllerStateChanged();
    }
  }
}
Program: 199121
Project: 199121
Buggy source:
public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!(obj instanceof RouteInfo))   return false;
  RouteInfo target=(RouteInfo)obj;
  return Objects.equals(mDestination,target.getDestination()) && Objects.equals(mGateway,target.getGateway()) && Objects.equals(mInterface,target.getInterface());
}

Fixed version (ground truth):
public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!(obj instanceof RouteInfo))   return false;
  RouteInfo target=(RouteInfo)obj;
  return Objects.equals(mDestination,target.getDestinationLinkAddress()) && Objects.equals(mGateway,target.getGateway()) && Objects.equals(mInterface,target.getInterface());
}
Program: 199122
Project: 199122
Buggy source:
@VisibleForTesting public void onReceiveInternal(Intent intent){
  final String action=intent.getAction();
  if (Intent.ACTION_BATTERY_LOW.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=false;
  }
 else   if (Intent.ACTION_BATTERY_OKAY.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=true;
    maybeReportNewChargingState();
  }
 else   if (Intent.ACTION_POWER_CONNECTED.equals(action)) {
    mAlarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,SystemClock.elapsedRealtime() + STABLE_CHARGING_THRESHOLD_MILLIS,mStableChargingTriggerIntent);
    mCharging=true;
  }
 else   if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) {
    mAlarm.cancel(mStableChargingTriggerIntent);
    mCharging=false;
    maybeReportNewChargingState();
  }
 else   if (ACTION_CHARGING_STABLE.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    if (mCharging) {
      maybeReportNewChargingState();
    }
  }
}

Fixed version (ground truth):
@VisibleForTesting public void onReceiveInternal(Intent intent){
  final String action=intent.getAction();
  if (Intent.ACTION_BATTERY_LOW.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=false;
  }
 else   if (Intent.ACTION_BATTERY_OKAY.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=true;
    maybeReportNewChargingState();
  }
 else   if (Intent.ACTION_POWER_CONNECTED.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + STABLE_CHARGING_THRESHOLD_MILLIS);
    }
    mAlarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,SystemClock.elapsedRealtime() + STABLE_CHARGING_THRESHOLD_MILLIS,mStableChargingTriggerIntent);
    mCharging=true;
  }
 else   if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str");
    }
    mAlarm.cancel(mStableChargingTriggerIntent);
    mCharging=false;
    maybeReportNewChargingState();
  }
 else   if (ACTION_CHARGING_STABLE.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime() + "String_Node_Str"+ mCharging);
    }
    if (mCharging) {
      maybeReportNewChargingState();
    }
  }
}
Program: 199123
Project: 199123
Buggy source:
public ChargingTracker(){
  mAlarm=(AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
  Intent intent=new Intent(ACTION_CHARGING_STABLE).setComponent(new ComponentName(mContext,this.getClass()));
  mStableChargingTriggerIntent=PendingIntent.getBroadcast(mContext,0,intent,0);
}

Fixed version (ground truth):
public ChargingTracker(){
  mAlarm=(AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
  Intent intent=new Intent(ACTION_CHARGING_STABLE);
  mStableChargingTriggerIntent=PendingIntent.getBroadcast(mContext,0,intent,0);
}
Program: 199124
Project: 199124
Buggy source:
private void maybeReportNewChargingState(){
  final boolean stablePower=mChargeTracker.isOnStablePower();
  boolean reportChange=false;
synchronized (mTrackedTasks) {
    for (    JobStatus ts : mTrackedTasks) {
      boolean previous=ts.chargingConstraintSatisfied.getAndSet(stablePower);
      if (previous != stablePower) {
        reportChange=true;
      }
    }
  }
  if (reportChange) {
    mStateChangedListener.onControllerStateChanged();
  }
}

Fixed version (ground truth):
private void maybeReportNewChargingState(){
  final boolean stablePower=mChargeTracker.isOnStablePower();
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + stablePower);
  }
  boolean reportChange=false;
synchronized (mTrackedTasks) {
    for (    JobStatus ts : mTrackedTasks) {
      boolean previous=ts.chargingConstraintSatisfied.getAndSet(stablePower);
      if (previous != stablePower) {
        reportChange=true;
      }
    }
  }
  if (reportChange) {
    mStateChangedListener.onControllerStateChanged();
  }
}
Program: 199125
Project: 199125
Buggy source:
public void startTracking(){
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_BATTERY_LOW);
  filter.addAction(Intent.ACTION_BATTERY_OKAY);
  filter.addAction(Intent.ACTION_POWER_CONNECTED);
  filter.addAction(Intent.ACTION_POWER_DISCONNECTED);
  mContext.registerReceiver(this,filter);
  BatteryService batteryService=(BatteryService)ServiceManager.getService("String_Node_Str");
  if (batteryService != null) {
    mBatteryHealthy=!batteryService.getBatteryLevelLow();
    mCharging=batteryService.isPowered(BatteryManager.BATTERY_PLUGGED_ANY);
  }
 else {
  }
}

Fixed version (ground truth):
public void startTracking(){
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_BATTERY_LOW);
  filter.addAction(Intent.ACTION_BATTERY_OKAY);
  filter.addAction(Intent.ACTION_POWER_CONNECTED);
  filter.addAction(Intent.ACTION_POWER_DISCONNECTED);
  filter.addAction(ACTION_CHARGING_STABLE);
  mContext.registerReceiver(this,filter);
  BatteryService batteryService=(BatteryService)ServiceManager.getService("String_Node_Str");
  if (batteryService != null) {
    mBatteryHealthy=!batteryService.getBatteryLevelLow();
    mCharging=batteryService.isPowered(BatteryManager.BATTERY_PLUGGED_ANY);
  }
 else {
  }
}
Program: 199126
Project: 199126
Buggy source:
@Override public void dumpControllerState(PrintWriter pw){
}

Fixed version (ground truth):
@Override public void dumpControllerState(PrintWriter pw){
  pw.println("String_Node_Str");
  pw.println("String_Node_Str" + mChargeTracker.isOnStablePower());
synchronized (mTrackedTasks) {
    Iterator<JobStatus> it=mTrackedTasks.iterator();
    if (it.hasNext()) {
      pw.print(String.valueOf(it.next().hashCode()));
    }
    while (it.hasNext()) {
      pw.print("String_Node_Str" + String.valueOf(it.next().hashCode()));
    }
    pw.println();
  }
}
Program: 199127
Project: 199127
Buggy source:
@Override public void maybeStartTrackingJob(JobStatus taskStatus){
  if (taskStatus.hasChargingConstraint()) {
synchronized (mTrackedTasks) {
      mTrackedTasks.add(taskStatus);
      taskStatus.chargingConstraintSatisfied.set(mChargeTracker.isOnStablePower());
    }
  }
}

Fixed version (ground truth):
@Override public void maybeStartTrackingJob(JobStatus taskStatus){
  if (taskStatus.hasChargingConstraint()) {
    final boolean isOnStablePower=mChargeTracker.isOnStablePower();
synchronized (mTrackedTasks) {
      mTrackedTasks.add(taskStatus);
      taskStatus.chargingConstraintSatisfied.set(isOnStablePower);
    }
    if (isOnStablePower) {
      mStateChangedListener.onControllerStateChanged();
    }
  }
}
Program: 199128
Project: 199128
Buggy source:
/** 
 * Compares this RouteInfo object against the specified object and indicates if they are equal.
 * @return {@code true} if the objects are equal, {@code false} otherwise.
 */
public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!(obj instanceof RouteInfo))   return false;
  RouteInfo target=(RouteInfo)obj;
  return Objects.equals(mDestination,target.getDestination()) && Objects.equals(mGateway,target.getGateway()) && Objects.equals(mInterface,target.getInterface());
}

Fixed version (ground truth):
/** 
 * Compares this RouteInfo object against the specified object and indicates if they are equal.
 * @return {@code true} if the objects are equal, {@code false} otherwise.
 */
public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!(obj instanceof RouteInfo))   return false;
  RouteInfo target=(RouteInfo)obj;
  return Objects.equals(mDestination,target.getDestinationLinkAddress()) && Objects.equals(mGateway,target.getGateway()) && Objects.equals(mInterface,target.getInterface());
}
Program: 199129
Project: 199129
Buggy source:
@VisibleForTesting public void onReceiveInternal(Intent intent){
  final String action=intent.getAction();
  if (Intent.ACTION_BATTERY_LOW.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=false;
  }
 else   if (Intent.ACTION_BATTERY_OKAY.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=true;
    maybeReportNewChargingState();
  }
 else   if (Intent.ACTION_POWER_CONNECTED.equals(action)) {
    mAlarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,SystemClock.elapsedRealtime() + STABLE_CHARGING_THRESHOLD_MILLIS,mStableChargingTriggerIntent);
    mCharging=true;
  }
 else   if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) {
    mAlarm.cancel(mStableChargingTriggerIntent);
    mCharging=false;
    maybeReportNewChargingState();
  }
 else   if (ACTION_CHARGING_STABLE.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    if (mCharging) {
      maybeReportNewChargingState();
    }
  }
}

Fixed version (ground truth):
@VisibleForTesting public void onReceiveInternal(Intent intent){
  final String action=intent.getAction();
  if (Intent.ACTION_BATTERY_LOW.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=false;
  }
 else   if (Intent.ACTION_BATTERY_OKAY.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
    }
    mBatteryHealthy=true;
    maybeReportNewChargingState();
  }
 else   if (Intent.ACTION_POWER_CONNECTED.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + STABLE_CHARGING_THRESHOLD_MILLIS);
    }
    mAlarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,SystemClock.elapsedRealtime() + STABLE_CHARGING_THRESHOLD_MILLIS,mStableChargingTriggerIntent);
    mCharging=true;
  }
 else   if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str");
    }
    mAlarm.cancel(mStableChargingTriggerIntent);
    mCharging=false;
    maybeReportNewChargingState();
  }
 else   if (ACTION_CHARGING_STABLE.equals(action)) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + SystemClock.elapsedRealtime() + "String_Node_Str"+ mCharging);
    }
    if (mCharging) {
      maybeReportNewChargingState();
    }
  }
}
Program: 199130
Project: 199130
Buggy source:
public ChargingTracker(){
  mAlarm=(AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
  Intent intent=new Intent(ACTION_CHARGING_STABLE).setComponent(new ComponentName(mContext,this.getClass()));
  mStableChargingTriggerIntent=PendingIntent.getBroadcast(mContext,0,intent,0);
}

Fixed version (ground truth):
public ChargingTracker(){
  mAlarm=(AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
  Intent intent=new Intent(ACTION_CHARGING_STABLE);
  mStableChargingTriggerIntent=PendingIntent.getBroadcast(mContext,0,intent,0);
}