nus-yam/ex-repair huggingface dataset:
Program: 512
Project: 512
Buggy source:
public boolean startReordering(){
  int dragViewIndex=getPageNearestToCenterOfScreen();
  mTempVisiblePagesRange[0]=0;
  mTempVisiblePagesRange[1]=getPageCount() - 1;
  boundByReorderablePages(true,mTempVisiblePagesRange);
  mReorderingStarted=true;
  if (mTempVisiblePagesRange[0] <= dragViewIndex && dragViewIndex <= mTempVisiblePagesRange[1]) {
    if (zoomOut()) {
      mDragView=getChildAt(dragViewIndex);
      onStartReordering();
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean startReordering(){
  int dragViewIndex=getPageNearestToCenterOfScreen();
  mTempVisiblePagesRange[0]=0;
  mTempVisiblePagesRange[1]=getPageCount() - 1;
  boundByReorderablePages(true,mTempVisiblePagesRange);
  if (mTempVisiblePagesRange[0] <= dragViewIndex && dragViewIndex <= mTempVisiblePagesRange[1]) {
    mReorderingStarted=true;
    if (zoomOut()) {
      mDragView=getChildAt(dragViewIndex);
      onStartReordering();
    }
    return true;
  }
  return false;
}
Program: 514
Project: 514
Buggy source:
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,false);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}

Fixed version (ground truth):
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,null);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}
Program: 518
Project: 518
Buggy source:
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,false);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}

Fixed version (ground truth):
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,null);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}
Program: 522
Project: 522
Buggy source:
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,false);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}

Fixed version (ground truth):
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,null);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}
Program: 526
Project: 526
Buggy source:
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,false);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}

Fixed version (ground truth):
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,null);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}
Program: 530
Project: 530
Buggy source:
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,false);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}

Fixed version (ground truth):
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,null);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}
Program: 534
Project: 534
Buggy source:
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,false);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}

Fixed version (ground truth):
public void setServiceForegroundLocked(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final int userId=UserHandle.getCallingUserId();
  final long origId=Binder.clearCallingIdentity();
  try {
    ServiceRecord r=findServiceLocked(className,token,userId);
    if (r != null) {
      if (id != 0) {
        if (notification == null) {
          throw new IllegalArgumentException("String_Node_Str");
        }
        if (r.foregroundId != id) {
          r.cancelNotification();
          r.foregroundId=id;
        }
        notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
        r.foregroundNoti=notification;
        r.isForeground=true;
        r.postNotification();
        if (r.app != null) {
          updateServiceForegroundLocked(r.app,true);
        }
        getServiceMap(r.userId).ensureNotStartingBackground(r);
      }
 else {
        if (r.isForeground) {
          r.isForeground=false;
          if (r.app != null) {
            mAm.updateLruProcessLocked(r.app,false,null);
            updateServiceForegroundLocked(r.app,true);
          }
        }
        if (removeNotification) {
          r.cancelNotification();
          r.foregroundId=0;
          r.foregroundNoti=null;
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}
Program: 537
Project: 537
Buggy source:
/** 
 * Communicate to client that the original request can't be done and client-requested fallback is happening. Fallback can be requested by the client by setting  {@link TextToSpeechClient.Params#FALLBACK_VOICE_ID} voice parameter with a id ofthe voice that is expected to be used for the fallback. This method will fail if user called  {@link #start(int,int,int)} and/or{@link #done()}. This method should only be called on the synthesis thread, while in   {@link TextToSpeechService#onSynthesizeTextV2}.
 * @return {@link TextToSpeech#SUCCESS},   {@link TextToSpeech#ERROR} if client alreadycalled  {@link #start(int,int,int)},   {@link TextToSpeechClient.Status#STOPPED}if stop was requested.
 */
public int fallback();

Fixed version (ground truth):
/** 
 * Communicate to client that the original request can't be done and client-requested fallback is happening. Fallback can be requested by the client by setting  {@link TextToSpeechClient.Params#FALLBACK_VOICE_NAME} voice parameter with a id ofthe voice that is expected to be used for the fallback. This method will fail if user called  {@link #start(int,int,int)} and/or{@link #done()}. This method should only be called on the synthesis thread, while in   {@link TextToSpeechService#onSynthesizeTextV2}.
 * @return {@link TextToSpeech#SUCCESS},   {@link TextToSpeech#ERROR} if client alreadycalled  {@link #start(int,int,int)},   {@link TextToSpeechClient.Status#STOPPED}if stop was requested.
 */
public int fallback();
Program: 538
Project: 538
Buggy source:
/** 
 * Communicate to client that the original request can't be done and client-requested fallback is happening. Fallback can be requested by the client by setting  {@link TextToSpeechClient.Params#FALLBACK_VOICE_ID} voice parameter with a id ofthe voice that is expected to be used for the fallback. This method will fail if user called  {@link #start(int,int,int)} and/or{@link #done()}. This method should only be called on the synthesis thread, while in   {@link TextToSpeechService#onSynthesizeTextV2}.
 * @return {@link TextToSpeech#SUCCESS},   {@link TextToSpeech#ERROR} if client alreadycalled  {@link #start(int,int,int)},   {@link TextToSpeechClient.Status#STOPPED}if stop was requested.
 */
public int fallback();

Fixed version (ground truth):
/** 
 * Communicate to client that the original request can't be done and client-requested fallback is happening. Fallback can be requested by the client by setting  {@link TextToSpeechClient.Params#FALLBACK_VOICE_NAME} voice parameter with a id ofthe voice that is expected to be used for the fallback. This method will fail if user called  {@link #start(int,int,int)} and/or{@link #done()}. This method should only be called on the synthesis thread, while in   {@link TextToSpeechService#onSynthesizeTextV2}.
 * @return {@link TextToSpeech#SUCCESS},   {@link TextToSpeech#ERROR} if client alreadycalled  {@link #start(int,int,int)},   {@link TextToSpeechClient.Status#STOPPED}if stop was requested.
 */
public int fallback();
Program: 539
Project: 539
Buggy source:
/** 
 * Communicate to client that the original request can't be done and client-requested fallback is happening. Fallback can be requested by the client by setting  {@link TextToSpeechClient.Params#FALLBACK_VOICE_ID} voice parameter with a id ofthe voice that is expected to be used for the fallback. This method will fail if user called  {@link #start(int,int,int)} and/or{@link #done()}. This method should only be called on the synthesis thread, while in   {@link TextToSpeechService#onSynthesizeTextV2}.
 * @return {@link TextToSpeech#SUCCESS},   {@link TextToSpeech#ERROR} if client alreadycalled  {@link #start(int,int,int)},   {@link TextToSpeechClient.Status#STOPPED}if stop was requested.
 */
public int fallback();

Fixed version (ground truth):
/** 
 * Communicate to client that the original request can't be done and client-requested fallback is happening. Fallback can be requested by the client by setting  {@link TextToSpeechClient.Params#FALLBACK_VOICE_NAME} voice parameter with a id ofthe voice that is expected to be used for the fallback. This method will fail if user called  {@link #start(int,int,int)} and/or{@link #done()}. This method should only be called on the synthesis thread, while in   {@link TextToSpeechService#onSynthesizeTextV2}.
 * @return {@link TextToSpeech#SUCCESS},   {@link TextToSpeech#ERROR} if client alreadycalled  {@link #start(int,int,int)},   {@link TextToSpeechClient.Status#STOPPED}if stop was requested.
 */
public int fallback();
Program: 540
Project: 540
Buggy source:
/** 
 * Implement this to handle requests to delete one or more rows. The implementation should apply the selection clause when performing deletion, allowing the operation to affect multiple rows in a directory. As a courtesy, call   {@link ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver) notifyDelete()}after deleting. This method can be called from multiple threads, as described in <a href="  {@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and Threads</a>. <p>The implementation is responsible for parsing out a row ID at the end of the URI, if a specific row is being deleted. That is, the client would pass in <code>content://contacts/people/22</code> and the implementation is responsible for parsing the record number (22) when creating a SQL statement.
 * @param uri The full URI to query, including a row ID (if a specific record is requested).
 * @param selection An optional restriction to apply to rows when deleting.
 * @return The number of rows affected.
 * @throws SQLException
 */
public abstract int delete(Uri uri,String selection,String[] selectionArgs);

Fixed version (ground truth):
/** 
 * Implement this to handle requests to delete one or more rows. The implementation should apply the selection clause when performing deletion, allowing the operation to affect multiple rows in a directory. As a courtesy, call   {@link ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver) notifyChange()}after deleting. This method can be called from multiple threads, as described in <a href="  {@docRoot}guide/topics/fundamentals/processes-and-threads.html#Threads">Processes and Threads</a>. <p>The implementation is responsible for parsing out a row ID at the end of the URI, if a specific row is being deleted. That is, the client would pass in <code>content://contacts/people/22</code> and the implementation is responsible for parsing the record number (22) when creating a SQL statement.
 * @param uri The full URI to query, including a row ID (if a specific record is requested).
 * @param selection An optional restriction to apply to rows when deleting.
 * @return The number of rows affected.
 * @throws SQLException
 */
public abstract int delete(Uri uri,String selection,String[] selectionArgs);
Program: 541
Project: 541
Buggy source:
/** 
 * Sets the right position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param right The bottom of this view, in pixels.
 */
public final void setRight(int right){
  if (right != mRight) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int maxRight;
        if (right < mRight) {
          maxRight=mRight;
        }
 else {
          maxRight=right;
        }
        invalidate(0,0,maxRight - mLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mRight=right;
    if (mDisplayList != null) {
      mDisplayList.setRight(mRight);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the right position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param right The right of this view, in pixels.
 */
public final void setRight(int right){
  if (right != mRight) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int maxRight;
        if (right < mRight) {
          maxRight=mRight;
        }
 else {
          maxRight=right;
        }
        invalidate(0,0,maxRight - mLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mRight=right;
    if (mDisplayList != null) {
      mDisplayList.setRight(mRight);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}
Program: 542
Project: 542
Buggy source:
/** 
 * Sets the left position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param left The bottom of this view, in pixels.
 */
public final void setLeft(int left){
  if (left != mLeft) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int minLeft;
        int xLoc;
        if (left < mLeft) {
          minLeft=left;
          xLoc=left - mLeft;
        }
 else {
          minLeft=mLeft;
          xLoc=0;
        }
        invalidate(xLoc,0,mRight - minLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mLeft=left;
    if (mDisplayList != null) {
      mDisplayList.setLeft(left);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the left position of this view relative to its parent. This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.
 * @param left The left of this view, in pixels.
 */
public final void setLeft(int left){
  if (left != mLeft) {
    updateMatrix();
    final boolean matrixIsIdentity=mTransformationInfo == null || mTransformationInfo.mMatrixIsIdentity;
    if (matrixIsIdentity) {
      if (mAttachInfo != null) {
        int minLeft;
        int xLoc;
        if (left < mLeft) {
          minLeft=left;
          xLoc=left - mLeft;
        }
 else {
          minLeft=mLeft;
          xLoc=0;
        }
        invalidate(xLoc,0,mRight - minLeft,mBottom - mTop);
      }
    }
 else {
      invalidate(true);
    }
    int oldWidth=mRight - mLeft;
    int height=mBottom - mTop;
    mLeft=left;
    if (mDisplayList != null) {
      mDisplayList.setLeft(left);
    }
    sizeChange(mRight - mLeft,height,oldWidth,height);
    if (!matrixIsIdentity) {
      if ((mPrivateFlags & PFLAG_PIVOT_EXPLICITLY_SET) == 0) {
        mTransformationInfo.mMatrixDirty=true;
      }
      mPrivateFlags|=PFLAG_DRAWN;
      invalidate(true);
    }
    mBackgroundSizeChanged=true;
    invalidateParentIfNeeded();
    if ((mPrivateFlags2 & PFLAG2_VIEW_QUICK_REJECTED) == PFLAG2_VIEW_QUICK_REJECTED) {
      invalidateParentIfNeeded();
    }
  }
}
Program: 543
Project: 543
Buggy source:
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    checkValidCaller(callingUid,userId);
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}

Fixed version (ground truth):
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}
Program: 544
Project: 544
Buggy source:
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkValidCaller(Binder.getCallingUid(),userId);
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}

Fixed version (ground truth):
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}
Program: 545
Project: 545
Buggy source:
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    checkValidCaller(callingUid,userId);
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}

Fixed version (ground truth):
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}
Program: 546
Project: 546
Buggy source:
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkValidCaller(Binder.getCallingUid(),userId);
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}

Fixed version (ground truth):
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}
Program: 547
Project: 547
Buggy source:
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    checkValidCaller(callingUid,userId);
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}

Fixed version (ground truth):
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}
Program: 548
Project: 548
Buggy source:
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkValidCaller(Binder.getCallingUid(),userId);
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}

Fixed version (ground truth):
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}
Program: 549
Project: 549
Buggy source:
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    checkValidCaller(callingUid,userId);
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}

Fixed version (ground truth):
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}
Program: 550
Project: 550
Buggy source:
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkValidCaller(Binder.getCallingUid(),userId);
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}

Fixed version (ground truth):
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}
Program: 551
Project: 551
Buggy source:
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    checkValidCaller(callingUid,userId);
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}

Fixed version (ground truth):
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}
Program: 552
Project: 552
Buggy source:
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkValidCaller(Binder.getCallingUid(),userId);
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}

Fixed version (ground truth):
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}
Program: 553
Project: 553
Buggy source:
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    checkValidCaller(callingUid,userId);
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}

Fixed version (ground truth):
public ComponentName startService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (DEBUG_SERVICE)   Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType);
synchronized (this) {
    final int callingPid=Binder.getCallingPid();
    final int callingUid=Binder.getCallingUid();
    final long origId=Binder.clearCallingIdentity();
    ComponentName res=mServices.startServiceLocked(caller,service,resolvedType,callingPid,callingUid,userId);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}
Program: 554
Project: 554
Buggy source:
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkValidCaller(Binder.getCallingUid(),userId);
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}

Fixed version (ground truth):
public int stopService(IApplicationThread caller,Intent service,String resolvedType,int userId){
  enforceNotIsolatedCaller("String_Node_Str");
  if (service != null && service.hasFileDescriptors() == true) {
    throw new IllegalArgumentException("String_Node_Str");
  }
synchronized (this) {
    return mServices.stopServiceLocked(caller,service,resolvedType,userId);
  }
}
Program: 555
Project: 555
Buggy source:
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(BUNDLE_MAGIC);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      int lengthPos=parcel.dataPosition();
      parcel.writeInt(-1);
      parcel.writeInt(BUNDLE_MAGIC);
      int startPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int endPos=parcel.dataPosition();
      parcel.setDataPosition(lengthPos);
      int length=endPos - startPos;
      parcel.writeInt(length);
      parcel.setDataPosition(endPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}

Fixed version (ground truth):
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      if (mParcelledData == EMPTY_PARCEL) {
        parcel.writeInt(0);
      }
 else {
        int length=mParcelledData.dataSize();
        parcel.writeInt(length);
        parcel.writeInt(BUNDLE_MAGIC);
        parcel.appendFrom(mParcelledData,0,length);
      }
    }
 else {
      if (mMap == null || mMap.size() <= 0) {
        parcel.writeInt(0);
        return;
      }
      int lengthPos=parcel.dataPosition();
      parcel.writeInt(-1);
      parcel.writeInt(BUNDLE_MAGIC);
      int startPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int endPos=parcel.dataPosition();
      parcel.setDataPosition(lengthPos);
      int length=endPos - startPos;
      parcel.writeInt(length);
      parcel.setDataPosition(endPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}