nus-yam/ex-repair huggingface dataset:
Program: 1891
Project: 1891
Buggy source:
private int getPaddingRightWithForeground(){
  return mForegroundInPadding ? Math.max(mPaddingRight,mForegroundPaddingRight) : mPaddingRight + mForegroundPaddingRight;
}

Fixed version (ground truth):
int getPaddingRightWithForeground(){
  return mForegroundInPadding ? Math.max(mPaddingRight,mForegroundPaddingRight) : mPaddingRight + mForegroundPaddingRight;
}
Program: 1892
Project: 1892
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  final int count=getChildCount();
  final int parentLeft=getPaddingLeftWithForeground();
  final int parentRight=right - left - getPaddingRightWithForeground();
  final int parentTop=getPaddingTopWithForeground();
  final int parentBottom=bottom - top - getPaddingBottomWithForeground();
  mForegroundBoundsChanged=true;
  for (int i=0; i < count; i++) {
    final View child=getChildAt(i);
    if (child.getVisibility() != GONE) {
      final LayoutParams lp=(LayoutParams)child.getLayoutParams();
      final int width=child.getMeasuredWidth();
      final int height=child.getMeasuredHeight();
      int childLeft;
      int childTop;
      int gravity=lp.gravity;
      if (gravity == -1) {
        gravity=DEFAULT_CHILD_GRAVITY;
      }
      final int layoutDirection=getLayoutDirection();
      final int absoluteGravity=Gravity.getAbsoluteGravity(gravity,layoutDirection);
      final int verticalGravity=gravity & Gravity.VERTICAL_GRAVITY_MASK;
switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
case Gravity.LEFT:
        childLeft=parentLeft + lp.leftMargin;
      break;
case Gravity.CENTER_HORIZONTAL:
    childLeft=parentLeft + (parentRight - parentLeft - width) / 2 + lp.leftMargin - lp.rightMargin;
  break;
case Gravity.RIGHT:
childLeft=parentRight - width - lp.rightMargin;
break;
default :
childLeft=parentLeft + lp.leftMargin;
}
switch (verticalGravity) {
case Gravity.TOP:
childTop=parentTop + lp.topMargin;
break;
case Gravity.CENTER_VERTICAL:
childTop=parentTop + (parentBottom - parentTop - height) / 2 + lp.topMargin - lp.bottomMargin;
break;
case Gravity.BOTTOM:
childTop=parentBottom - height - lp.bottomMargin;
break;
default :
childTop=parentTop + lp.topMargin;
}
child.layout(childLeft,childTop,childLeft + width,childTop + height);
}
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  layoutChildren(left,top,right,bottom,false);
}
Program: 1893
Project: 1893
Buggy source:
private int getPaddingLeftWithForeground(){
  return mForegroundInPadding ? Math.max(mPaddingLeft,mForegroundPaddingLeft) : mPaddingLeft + mForegroundPaddingLeft;
}

Fixed version (ground truth):
int getPaddingLeftWithForeground(){
  return mForegroundInPadding ? Math.max(mPaddingLeft,mForegroundPaddingLeft) : mPaddingLeft + mForegroundPaddingLeft;
}
Program: 1894
Project: 1894
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  super.onLayout(changed,l,t,r,b);
  mIsLayoutDirty=false;
  if (mChildToScrollTo != null && isViewDescendantOf(mChildToScrollTo,this)) {
    scrollToChild(mChildToScrollTo);
  }
  mChildToScrollTo=null;
  scrollTo(mScrollX,mScrollY);
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  final View child=getChildAt(0);
  final int childWidth=child.getMeasuredWidth();
  final LayoutParams childParams=(LayoutParams)child.getLayoutParams();
  final int available=r - l - getPaddingLeftWithForeground()- getPaddingRightWithForeground()- childParams.leftMargin- childParams.rightMargin;
  final boolean forceLeftGravity=(childWidth > available);
  layoutChildren(l,t,r,b,forceLeftGravity);
  mIsLayoutDirty=false;
  if (mChildToScrollTo != null && isViewDescendantOf(mChildToScrollTo,this)) {
    scrollToChild(mChildToScrollTo);
  }
  mChildToScrollTo=null;
  if (!hasLayout()) {
    final int scrollRange=Math.max(0,childWidth - (r - l - mPaddingLeft- mPaddingRight));
    if (mSavedState != null) {
      if (isLayoutRtl() == mSavedState.isLayoutRtl) {
        mScrollX=mSavedState.scrollPosition;
      }
 else {
        mScrollX=scrollRange - mSavedState.scrollPosition;
      }
    }
 else {
      if (isLayoutRtl()) {
        mScrollX=scrollRange - mScrollX;
      }
    }
    if (mScrollX > scrollRange) {
      mScrollX=scrollRange;
    }
 else     if (mScrollX < 0) {
      mScrollX=0;
    }
  }
  scrollTo(mScrollX,mScrollY);
}
Program: 1895
Project: 1895
Buggy source:
/** 
 * Private method containing a userId
 * @hide
 */
protected void onProvidersChanged(int userId){
}

Fixed version (ground truth):
/** 
 * Called when the set of available widgets changes (ie. widget containing packages are added, updated or removed, or widget components are enabled or disabled.)
 */
protected void onProvidersChanged(){
}
Program: 1896
Project: 1896
Buggy source:
public void handleMessage(Message msg){
switch (msg.what) {
case HANDLE_UPDATE:
{
      updateAppWidgetView(msg.arg1,(RemoteViews)msg.obj,msg.arg2);
      break;
    }
case HANDLE_PROVIDER_CHANGED:
{
    onProviderChanged(msg.arg1,(AppWidgetProviderInfo)msg.obj);
    break;
  }
case HANDLE_PROVIDERS_CHANGED:
{
  onProvidersChanged(msg.arg1);
  break;
}
case HANDLE_VIEW_DATA_CHANGED:
{
viewDataChanged(msg.arg1,msg.arg2,(Integer)msg.obj);
break;
}
}
}

Fixed version (ground truth):
public void handleMessage(Message msg){
switch (msg.what) {
case HANDLE_UPDATE:
{
      updateAppWidgetView(msg.arg1,(RemoteViews)msg.obj,msg.arg2);
      break;
    }
case HANDLE_PROVIDER_CHANGED:
{
    onProviderChanged(msg.arg1,(AppWidgetProviderInfo)msg.obj);
    break;
  }
case HANDLE_PROVIDERS_CHANGED:
{
  onProvidersChanged();
  break;
}
case HANDLE_VIEW_DATA_CHANGED:
{
viewDataChanged(msg.arg1,msg.arg2,(Integer)msg.obj);
break;
}
}
}
Program: 1899
Project: 1899
Buggy source:
/** 
 * Create new SpellCheckSpans on the modified region.
 */
private void updateSpellCheckSpans(int start,int end,boolean createSpellChecker){
  if (mTextView.isTextEditable() && mTextView.isSuggestionsEnabled() && !(mTextView instanceof ExtractEditText)) {
    if (mSpellChecker == null && createSpellChecker) {
      mSpellChecker=new SpellChecker(mTextView);
    }
    if (mSpellChecker != null) {
      mSpellChecker.spellCheck(start,end);
    }
  }
}

Fixed version (ground truth):
/** 
 * Create new SpellCheckSpans on the modified region.
 */
private void updateSpellCheckSpans(int start,int end,boolean createSpellChecker){
  mTextView.removeAdjacentSuggestionSpans(start);
  mTextView.removeAdjacentSuggestionSpans(end);
  if (mTextView.isTextEditable() && mTextView.isSuggestionsEnabled() && !(mTextView instanceof ExtractEditText)) {
    if (mSpellChecker == null && createSpellChecker) {
      mSpellChecker=new SpellChecker(mTextView);
    }
    if (mSpellChecker != null) {
      mSpellChecker.spellCheck(start,end);
    }
  }
}
Program: 1900
Project: 1900
Buggy source:
private void sendBeforeTextChanged(CharSequence text,int start,int before,int after){
  if (mListeners != null) {
    final ArrayList<TextWatcher> list=mListeners;
    final int count=list.size();
    for (int i=0; i < count; i++) {
      list.get(i).beforeTextChanged(text,start,before,after);
    }
  }
  removeIntersectingSpans(start,start + before,SpellCheckSpan.class);
  removeIntersectingSpans(start,start + before,SuggestionSpan.class);
}

Fixed version (ground truth):
private void sendBeforeTextChanged(CharSequence text,int start,int before,int after){
  if (mListeners != null) {
    final ArrayList<TextWatcher> list=mListeners;
    final int count=list.size();
    for (int i=0; i < count; i++) {
      list.get(i).beforeTextChanged(text,start,before,after);
    }
  }
  removeIntersectingNonAdjacentSpans(start,start + before,SpellCheckSpan.class);
  removeIntersectingNonAdjacentSpans(start,start + before,SuggestionSpan.class);
}
Program: 1901
Project: 1901
Buggy source:
@Override public void requestLocationUpdates(LocationRequest request,ILocationListener listener,PendingIntent intent,String packageName){
  if (request == null)   request=DEFAULT_LOCATION_REQUEST;
  checkPackageName(packageName);
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,request.getProvider());
  LocationRequest sanitizedRequest=createSanitizedRequest(request,allowedResolutionLevel);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  long identity=Binder.clearCallingIdentity();
  try {
    checkLocationAccess(uid,packageName,allowedResolutionLevel);
    Receiver recevier=checkListenerOrIntent(listener,intent,pid,uid,packageName);
synchronized (mLock) {
      requestLocationUpdatesLocked(sanitizedRequest,recevier,pid,uid,packageName);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void requestLocationUpdates(LocationRequest request,ILocationListener listener,PendingIntent intent,String packageName){
  if (request == null)   request=DEFAULT_LOCATION_REQUEST;
  checkPackageName(packageName);
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,request.getProvider());
  LocationRequest sanitizedRequest=createSanitizedRequest(request,allowedResolutionLevel);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  long identity=Binder.clearCallingIdentity();
  try {
    checkLocationAccess(uid,packageName,allowedResolutionLevel);
synchronized (mLock) {
      Receiver recevier=checkListenerOrIntentLocked(listener,intent,pid,uid,packageName);
      requestLocationUpdatesLocked(sanitizedRequest,recevier,pid,uid,packageName);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}
Program: 1902
Project: 1902
Buggy source:
@Override public void removeUpdates(ILocationListener listener,PendingIntent intent,String packageName){
  checkPackageName(packageName);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  Receiver receiver=checkListenerOrIntent(listener,intent,pid,uid,packageName);
  long identity=Binder.clearCallingIdentity();
  try {
synchronized (mLock) {
      removeUpdatesLocked(receiver);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void removeUpdates(ILocationListener listener,PendingIntent intent,String packageName){
  checkPackageName(packageName);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
synchronized (mLock) {
    Receiver receiver=checkListenerOrIntentLocked(listener,intent,pid,uid,packageName);
    long identity=Binder.clearCallingIdentity();
    try {
      removeUpdatesLocked(receiver);
    }
  finally {
      Binder.restoreCallingIdentity(identity);
    }
  }
}
Program: 1903
Project: 1903
Buggy source:
@Override public void locationCallbackFinished(ILocationListener listener){
  IBinder binder=listener.asBinder();
  Receiver receiver=mReceivers.get(binder);
  if (receiver != null) {
synchronized (receiver) {
      long identity=Binder.clearCallingIdentity();
      receiver.decrementPendingBroadcastsLocked();
      Binder.restoreCallingIdentity(identity);
    }
  }
}

Fixed version (ground truth):
@Override public void locationCallbackFinished(ILocationListener listener){
synchronized (mLock) {
    IBinder binder=listener.asBinder();
    Receiver receiver=mReceivers.get(binder);
    if (receiver != null) {
synchronized (receiver) {
        long identity=Binder.clearCallingIdentity();
        receiver.decrementPendingBroadcastsLocked();
        Binder.restoreCallingIdentity(identity);
      }
    }
  }
}
Program: 1904
Project: 1904
Buggy source:
@Override public void requestLocationUpdates(LocationRequest request,ILocationListener listener,PendingIntent intent,String packageName){
  if (request == null)   request=DEFAULT_LOCATION_REQUEST;
  checkPackageName(packageName);
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,request.getProvider());
  LocationRequest sanitizedRequest=createSanitizedRequest(request,allowedResolutionLevel);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  long identity=Binder.clearCallingIdentity();
  try {
    checkLocationAccess(uid,packageName,allowedResolutionLevel);
    Receiver recevier=checkListenerOrIntent(listener,intent,pid,uid,packageName);
synchronized (mLock) {
      requestLocationUpdatesLocked(sanitizedRequest,recevier,pid,uid,packageName);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void requestLocationUpdates(LocationRequest request,ILocationListener listener,PendingIntent intent,String packageName){
  if (request == null)   request=DEFAULT_LOCATION_REQUEST;
  checkPackageName(packageName);
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,request.getProvider());
  LocationRequest sanitizedRequest=createSanitizedRequest(request,allowedResolutionLevel);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  long identity=Binder.clearCallingIdentity();
  try {
    checkLocationAccess(uid,packageName,allowedResolutionLevel);
synchronized (mLock) {
      Receiver recevier=checkListenerOrIntentLocked(listener,intent,pid,uid,packageName);
      requestLocationUpdatesLocked(sanitizedRequest,recevier,pid,uid,packageName);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}
Program: 1905
Project: 1905
Buggy source:
@Override public void removeUpdates(ILocationListener listener,PendingIntent intent,String packageName){
  checkPackageName(packageName);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  Receiver receiver=checkListenerOrIntent(listener,intent,pid,uid,packageName);
  long identity=Binder.clearCallingIdentity();
  try {
synchronized (mLock) {
      removeUpdatesLocked(receiver);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void removeUpdates(ILocationListener listener,PendingIntent intent,String packageName){
  checkPackageName(packageName);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
synchronized (mLock) {
    Receiver receiver=checkListenerOrIntentLocked(listener,intent,pid,uid,packageName);
    long identity=Binder.clearCallingIdentity();
    try {
      removeUpdatesLocked(receiver);
    }
  finally {
      Binder.restoreCallingIdentity(identity);
    }
  }
}
Program: 1906
Project: 1906
Buggy source:
@Override public void locationCallbackFinished(ILocationListener listener){
  IBinder binder=listener.asBinder();
  Receiver receiver=mReceivers.get(binder);
  if (receiver != null) {
synchronized (receiver) {
      long identity=Binder.clearCallingIdentity();
      receiver.decrementPendingBroadcastsLocked();
      Binder.restoreCallingIdentity(identity);
    }
  }
}

Fixed version (ground truth):
@Override public void locationCallbackFinished(ILocationListener listener){
synchronized (mLock) {
    IBinder binder=listener.asBinder();
    Receiver receiver=mReceivers.get(binder);
    if (receiver != null) {
synchronized (receiver) {
        long identity=Binder.clearCallingIdentity();
        receiver.decrementPendingBroadcastsLocked();
        Binder.restoreCallingIdentity(identity);
      }
    }
  }
}
Program: 1907
Project: 1907
Buggy source:
@Override public void requestLocationUpdates(LocationRequest request,ILocationListener listener,PendingIntent intent,String packageName){
  if (request == null)   request=DEFAULT_LOCATION_REQUEST;
  checkPackageName(packageName);
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,request.getProvider());
  LocationRequest sanitizedRequest=createSanitizedRequest(request,allowedResolutionLevel);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  long identity=Binder.clearCallingIdentity();
  try {
    checkLocationAccess(uid,packageName,allowedResolutionLevel);
    Receiver recevier=checkListenerOrIntent(listener,intent,pid,uid,packageName);
synchronized (mLock) {
      requestLocationUpdatesLocked(sanitizedRequest,recevier,pid,uid,packageName);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void requestLocationUpdates(LocationRequest request,ILocationListener listener,PendingIntent intent,String packageName){
  if (request == null)   request=DEFAULT_LOCATION_REQUEST;
  checkPackageName(packageName);
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,request.getProvider());
  LocationRequest sanitizedRequest=createSanitizedRequest(request,allowedResolutionLevel);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  long identity=Binder.clearCallingIdentity();
  try {
    checkLocationAccess(uid,packageName,allowedResolutionLevel);
synchronized (mLock) {
      Receiver recevier=checkListenerOrIntentLocked(listener,intent,pid,uid,packageName);
      requestLocationUpdatesLocked(sanitizedRequest,recevier,pid,uid,packageName);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}
Program: 1908
Project: 1908
Buggy source:
@Override public void removeUpdates(ILocationListener listener,PendingIntent intent,String packageName){
  checkPackageName(packageName);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  Receiver receiver=checkListenerOrIntent(listener,intent,pid,uid,packageName);
  long identity=Binder.clearCallingIdentity();
  try {
synchronized (mLock) {
      removeUpdatesLocked(receiver);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void removeUpdates(ILocationListener listener,PendingIntent intent,String packageName){
  checkPackageName(packageName);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
synchronized (mLock) {
    Receiver receiver=checkListenerOrIntentLocked(listener,intent,pid,uid,packageName);
    long identity=Binder.clearCallingIdentity();
    try {
      removeUpdatesLocked(receiver);
    }
  finally {
      Binder.restoreCallingIdentity(identity);
    }
  }
}
Program: 1909
Project: 1909
Buggy source:
@Override public void locationCallbackFinished(ILocationListener listener){
  IBinder binder=listener.asBinder();
  Receiver receiver=mReceivers.get(binder);
  if (receiver != null) {
synchronized (receiver) {
      long identity=Binder.clearCallingIdentity();
      receiver.decrementPendingBroadcastsLocked();
      Binder.restoreCallingIdentity(identity);
    }
  }
}

Fixed version (ground truth):
@Override public void locationCallbackFinished(ILocationListener listener){
synchronized (mLock) {
    IBinder binder=listener.asBinder();
    Receiver receiver=mReceivers.get(binder);
    if (receiver != null) {
synchronized (receiver) {
        long identity=Binder.clearCallingIdentity();
        receiver.decrementPendingBroadcastsLocked();
        Binder.restoreCallingIdentity(identity);
      }
    }
  }
}
Program: 1910
Project: 1910
Buggy source:
@Override public void requestLocationUpdates(LocationRequest request,ILocationListener listener,PendingIntent intent,String packageName){
  if (request == null)   request=DEFAULT_LOCATION_REQUEST;
  checkPackageName(packageName);
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,request.getProvider());
  LocationRequest sanitizedRequest=createSanitizedRequest(request,allowedResolutionLevel);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  long identity=Binder.clearCallingIdentity();
  try {
    checkLocationAccess(uid,packageName,allowedResolutionLevel);
    Receiver recevier=checkListenerOrIntent(listener,intent,pid,uid,packageName);
synchronized (mLock) {
      requestLocationUpdatesLocked(sanitizedRequest,recevier,pid,uid,packageName);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void requestLocationUpdates(LocationRequest request,ILocationListener listener,PendingIntent intent,String packageName){
  if (request == null)   request=DEFAULT_LOCATION_REQUEST;
  checkPackageName(packageName);
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,request.getProvider());
  LocationRequest sanitizedRequest=createSanitizedRequest(request,allowedResolutionLevel);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  long identity=Binder.clearCallingIdentity();
  try {
    checkLocationAccess(uid,packageName,allowedResolutionLevel);
synchronized (mLock) {
      Receiver recevier=checkListenerOrIntentLocked(listener,intent,pid,uid,packageName);
      requestLocationUpdatesLocked(sanitizedRequest,recevier,pid,uid,packageName);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}
Program: 1911
Project: 1911
Buggy source:
@Override public void removeUpdates(ILocationListener listener,PendingIntent intent,String packageName){
  checkPackageName(packageName);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  Receiver receiver=checkListenerOrIntent(listener,intent,pid,uid,packageName);
  long identity=Binder.clearCallingIdentity();
  try {
synchronized (mLock) {
      removeUpdatesLocked(receiver);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void removeUpdates(ILocationListener listener,PendingIntent intent,String packageName){
  checkPackageName(packageName);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
synchronized (mLock) {
    Receiver receiver=checkListenerOrIntentLocked(listener,intent,pid,uid,packageName);
    long identity=Binder.clearCallingIdentity();
    try {
      removeUpdatesLocked(receiver);
    }
  finally {
      Binder.restoreCallingIdentity(identity);
    }
  }
}
Program: 1912
Project: 1912
Buggy source:
@Override public void locationCallbackFinished(ILocationListener listener){
  IBinder binder=listener.asBinder();
  Receiver receiver=mReceivers.get(binder);
  if (receiver != null) {
synchronized (receiver) {
      long identity=Binder.clearCallingIdentity();
      receiver.decrementPendingBroadcastsLocked();
      Binder.restoreCallingIdentity(identity);
    }
  }
}

Fixed version (ground truth):
@Override public void locationCallbackFinished(ILocationListener listener){
synchronized (mLock) {
    IBinder binder=listener.asBinder();
    Receiver receiver=mReceivers.get(binder);
    if (receiver != null) {
synchronized (receiver) {
        long identity=Binder.clearCallingIdentity();
        receiver.decrementPendingBroadcastsLocked();
        Binder.restoreCallingIdentity(identity);
      }
    }
  }
}
Program: 1913
Project: 1913
Buggy source:
@Override public void requestLocationUpdates(LocationRequest request,ILocationListener listener,PendingIntent intent,String packageName){
  if (request == null)   request=DEFAULT_LOCATION_REQUEST;
  checkPackageName(packageName);
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,request.getProvider());
  LocationRequest sanitizedRequest=createSanitizedRequest(request,allowedResolutionLevel);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  long identity=Binder.clearCallingIdentity();
  try {
    checkLocationAccess(uid,packageName,allowedResolutionLevel);
    Receiver recevier=checkListenerOrIntent(listener,intent,pid,uid,packageName);
synchronized (mLock) {
      requestLocationUpdatesLocked(sanitizedRequest,recevier,pid,uid,packageName);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void requestLocationUpdates(LocationRequest request,ILocationListener listener,PendingIntent intent,String packageName){
  if (request == null)   request=DEFAULT_LOCATION_REQUEST;
  checkPackageName(packageName);
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,request.getProvider());
  LocationRequest sanitizedRequest=createSanitizedRequest(request,allowedResolutionLevel);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  long identity=Binder.clearCallingIdentity();
  try {
    checkLocationAccess(uid,packageName,allowedResolutionLevel);
synchronized (mLock) {
      Receiver recevier=checkListenerOrIntentLocked(listener,intent,pid,uid,packageName);
      requestLocationUpdatesLocked(sanitizedRequest,recevier,pid,uid,packageName);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}
Program: 1914
Project: 1914
Buggy source:
@Override public void removeUpdates(ILocationListener listener,PendingIntent intent,String packageName){
  checkPackageName(packageName);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
  Receiver receiver=checkListenerOrIntent(listener,intent,pid,uid,packageName);
  long identity=Binder.clearCallingIdentity();
  try {
synchronized (mLock) {
      removeUpdatesLocked(receiver);
    }
  }
  finally {
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
@Override public void removeUpdates(ILocationListener listener,PendingIntent intent,String packageName){
  checkPackageName(packageName);
  final int pid=Binder.getCallingPid();
  final int uid=Binder.getCallingUid();
synchronized (mLock) {
    Receiver receiver=checkListenerOrIntentLocked(listener,intent,pid,uid,packageName);
    long identity=Binder.clearCallingIdentity();
    try {
      removeUpdatesLocked(receiver);
    }
  finally {
      Binder.restoreCallingIdentity(identity);
    }
  }
}
Program: 1915
Project: 1915
Buggy source:
@Override public void locationCallbackFinished(ILocationListener listener){
  IBinder binder=listener.asBinder();
  Receiver receiver=mReceivers.get(binder);
  if (receiver != null) {
synchronized (receiver) {
      long identity=Binder.clearCallingIdentity();
      receiver.decrementPendingBroadcastsLocked();
      Binder.restoreCallingIdentity(identity);
    }
  }
}

Fixed version (ground truth):
@Override public void locationCallbackFinished(ILocationListener listener){
synchronized (mLock) {
    IBinder binder=listener.asBinder();
    Receiver receiver=mReceivers.get(binder);
    if (receiver != null) {
synchronized (receiver) {
        long identity=Binder.clearCallingIdentity();
        receiver.decrementPendingBroadcastsLocked();
        Binder.restoreCallingIdentity(identity);
      }
    }
  }
}
Program: 1916
Project: 1916
Buggy source:
/** 
 * Private method containing a userId
 * @hide
 */
protected void onProvidersChanged(int userId){
}

Fixed version (ground truth):
/** 
 * Called when the set of available widgets changes (ie. widget containing packages are added, updated or removed, or widget components are enabled or disabled.)
 */
protected void onProvidersChanged(){
}
Program: 1917
Project: 1917
Buggy source:
public void handleMessage(Message msg){
switch (msg.what) {
case HANDLE_UPDATE:
{
      updateAppWidgetView(msg.arg1,(RemoteViews)msg.obj,msg.arg2);
      break;
    }
case HANDLE_PROVIDER_CHANGED:
{
    onProviderChanged(msg.arg1,(AppWidgetProviderInfo)msg.obj);
    break;
  }
case HANDLE_PROVIDERS_CHANGED:
{
  onProvidersChanged(msg.arg1);
  break;
}
case HANDLE_VIEW_DATA_CHANGED:
{
viewDataChanged(msg.arg1,msg.arg2,(Integer)msg.obj);
break;
}
}
}

Fixed version (ground truth):
public void handleMessage(Message msg){
switch (msg.what) {
case HANDLE_UPDATE:
{
      updateAppWidgetView(msg.arg1,(RemoteViews)msg.obj,msg.arg2);
      break;
    }
case HANDLE_PROVIDER_CHANGED:
{
    onProviderChanged(msg.arg1,(AppWidgetProviderInfo)msg.obj);
    break;
  }
case HANDLE_PROVIDERS_CHANGED:
{
  onProvidersChanged();
  break;
}
case HANDLE_VIEW_DATA_CHANGED:
{
viewDataChanged(msg.arg1,msg.arg2,(Integer)msg.obj);
break;
}
}
}
Program: 1918
Project: 1918
Buggy source:
/** 
 * Private method containing a userId
 * @hide
 */
protected void onProvidersChanged(int userId){
}

Fixed version (ground truth):
/** 
 * Called when the set of available widgets changes (ie. widget containing packages are added, updated or removed, or widget components are enabled or disabled.)
 */
protected void onProvidersChanged(){
}
Program: 1919
Project: 1919
Buggy source:
public void handleMessage(Message msg){
switch (msg.what) {
case HANDLE_UPDATE:
{
      updateAppWidgetView(msg.arg1,(RemoteViews)msg.obj,msg.arg2);
      break;
    }
case HANDLE_PROVIDER_CHANGED:
{
    onProviderChanged(msg.arg1,(AppWidgetProviderInfo)msg.obj);
    break;
  }
case HANDLE_PROVIDERS_CHANGED:
{
  onProvidersChanged(msg.arg1);
  break;
}
case HANDLE_VIEW_DATA_CHANGED:
{
viewDataChanged(msg.arg1,msg.arg2,(Integer)msg.obj);
break;
}
}
}

Fixed version (ground truth):
public void handleMessage(Message msg){
switch (msg.what) {
case HANDLE_UPDATE:
{
      updateAppWidgetView(msg.arg1,(RemoteViews)msg.obj,msg.arg2);
      break;
    }
case HANDLE_PROVIDER_CHANGED:
{
    onProviderChanged(msg.arg1,(AppWidgetProviderInfo)msg.obj);
    break;
  }
case HANDLE_PROVIDERS_CHANGED:
{
  onProvidersChanged();
  break;
}
case HANDLE_VIEW_DATA_CHANGED:
{
viewDataChanged(msg.arg1,msg.arg2,(Integer)msg.obj);
break;
}
}
}
Program: 1920
Project: 1920
Buggy source:
/** 
 * Private method containing a userId
 * @hide
 */
protected void onProvidersChanged(int userId){
}

Fixed version (ground truth):
/** 
 * Called when the set of available widgets changes (ie. widget containing packages are added, updated or removed, or widget components are enabled or disabled.)
 */
protected void onProvidersChanged(){
}
Program: 1921
Project: 1921
Buggy source:
public void handleMessage(Message msg){
switch (msg.what) {
case HANDLE_UPDATE:
{
      updateAppWidgetView(msg.arg1,(RemoteViews)msg.obj,msg.arg2);
      break;
    }
case HANDLE_PROVIDER_CHANGED:
{
    onProviderChanged(msg.arg1,(AppWidgetProviderInfo)msg.obj);
    break;
  }
case HANDLE_PROVIDERS_CHANGED:
{
  onProvidersChanged(msg.arg1);
  break;
}
case HANDLE_VIEW_DATA_CHANGED:
{
viewDataChanged(msg.arg1,msg.arg2,(Integer)msg.obj);
break;
}
}
}

Fixed version (ground truth):
public void handleMessage(Message msg){
switch (msg.what) {
case HANDLE_UPDATE:
{
      updateAppWidgetView(msg.arg1,(RemoteViews)msg.obj,msg.arg2);
      break;
    }
case HANDLE_PROVIDER_CHANGED:
{
    onProviderChanged(msg.arg1,(AppWidgetProviderInfo)msg.obj);
    break;
  }
case HANDLE_PROVIDERS_CHANGED:
{
  onProvidersChanged();
  break;
}
case HANDLE_VIEW_DATA_CHANGED:
{
viewDataChanged(msg.arg1,msg.arg2,(Integer)msg.obj);
break;
}
}
}
Program: 1922
Project: 1922
Buggy source:
/** 
 * Create new SpellCheckSpans on the modified region.
 */
private void updateSpellCheckSpans(int start,int end,boolean createSpellChecker){
  if (mTextView.isTextEditable() && mTextView.isSuggestionsEnabled() && !(mTextView instanceof ExtractEditText)) {
    if (mSpellChecker == null && createSpellChecker) {
      mSpellChecker=new SpellChecker(mTextView);
    }
    if (mSpellChecker != null) {
      mSpellChecker.spellCheck(start,end);
    }
  }
}

Fixed version (ground truth):
/** 
 * Create new SpellCheckSpans on the modified region.
 */
private void updateSpellCheckSpans(int start,int end,boolean createSpellChecker){
  mTextView.removeAdjacentSuggestionSpans(start);
  mTextView.removeAdjacentSuggestionSpans(end);
  if (mTextView.isTextEditable() && mTextView.isSuggestionsEnabled() && !(mTextView instanceof ExtractEditText)) {
    if (mSpellChecker == null && createSpellChecker) {
      mSpellChecker=new SpellChecker(mTextView);
    }
    if (mSpellChecker != null) {
      mSpellChecker.spellCheck(start,end);
    }
  }
}
Program: 1923
Project: 1923
Buggy source:
private void sendBeforeTextChanged(CharSequence text,int start,int before,int after){
  if (mListeners != null) {
    final ArrayList<TextWatcher> list=mListeners;
    final int count=list.size();
    for (int i=0; i < count; i++) {
      list.get(i).beforeTextChanged(text,start,before,after);
    }
  }
  removeIntersectingSpans(start,start + before,SpellCheckSpan.class);
  removeIntersectingSpans(start,start + before,SuggestionSpan.class);
}

Fixed version (ground truth):
private void sendBeforeTextChanged(CharSequence text,int start,int before,int after){
  if (mListeners != null) {
    final ArrayList<TextWatcher> list=mListeners;
    final int count=list.size();
    for (int i=0; i < count; i++) {
      list.get(i).beforeTextChanged(text,start,before,after);
    }
  }
  removeIntersectingNonAdjacentSpans(start,start + before,SpellCheckSpan.class);
  removeIntersectingNonAdjacentSpans(start,start + before,SuggestionSpan.class);
}
Program: 1924
Project: 1924
Buggy source:
/** 
 * Private method containing a userId
 * @hide
 */
protected void onProvidersChanged(int userId){
}

Fixed version (ground truth):
/** 
 * Called when the set of available widgets changes (ie. widget containing packages are added, updated or removed, or widget components are enabled or disabled.)
 */
protected void onProvidersChanged(){
}
Program: 1925
Project: 1925
Buggy source:
public void handleMessage(Message msg){
switch (msg.what) {
case HANDLE_UPDATE:
{
      updateAppWidgetView(msg.arg1,(RemoteViews)msg.obj,msg.arg2);
      break;
    }
case HANDLE_PROVIDER_CHANGED:
{
    onProviderChanged(msg.arg1,(AppWidgetProviderInfo)msg.obj);
    break;
  }
case HANDLE_PROVIDERS_CHANGED:
{
  onProvidersChanged(msg.arg1);
  break;
}
case HANDLE_VIEW_DATA_CHANGED:
{
viewDataChanged(msg.arg1,msg.arg2,(Integer)msg.obj);
break;
}
}
}

Fixed version (ground truth):
public void handleMessage(Message msg){
switch (msg.what) {
case HANDLE_UPDATE:
{
      updateAppWidgetView(msg.arg1,(RemoteViews)msg.obj,msg.arg2);
      break;
    }
case HANDLE_PROVIDER_CHANGED:
{
    onProviderChanged(msg.arg1,(AppWidgetProviderInfo)msg.obj);
    break;
  }
case HANDLE_PROVIDERS_CHANGED:
{
  onProvidersChanged();
  break;
}
case HANDLE_VIEW_DATA_CHANGED:
{
viewDataChanged(msg.arg1,msg.arg2,(Integer)msg.obj);
break;
}
}
}
Program: 1926
Project: 1926
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  mPlaybackState=dcs.playbackState;
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ mPlaybackState);
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}
Program: 1927
Project: 1927
Buggy source:
@Override void onMusicClientIdChanged(int clientGeneration,boolean clearing,android.app.PendingIntent intent){
  if (DEBUGXPORT && (mClientGeneration != clientGeneration || clearing)) {
    Log.v(TAG,(clearing ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + clientGeneration);
  }
  mClientGeneration=clientGeneration;
  mTransportState=(clearing ? TRANSPORT_GONE : TRANSPORT_INVISIBLE);
  KeyguardHostView.this.post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override void onMusicClientIdChanged(int clientGeneration,boolean clearing,android.app.PendingIntent intent){
  if (DEBUGXPORT && (mClientGeneration != clientGeneration || clearing)) {
    Log.v(TAG,(clearing ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + clientGeneration);
  }
  mClientGeneration=clientGeneration;
  final int newState=(clearing ? TRANSPORT_GONE : (mTransportState == TRANSPORT_VISIBLE ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (newState != mTransportState) {
    mTransportState=newState;
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    KeyguardHostView.this.post(mSwitchPageRunnable);
  }
}
Program: 1928
Project: 1928
Buggy source:
@Override public void onMusicPlaybackStateChanged(int playbackState,long eventTime){
  mPlaybackState=playbackState;
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + playbackState);
  if (mTransportState != TRANSPORT_GONE) {
    mTransportState=(isMusicPlaying(mPlaybackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE);
  }
  KeyguardHostView.this.post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onMusicPlaybackStateChanged(int playbackState,long eventTime){
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + playbackState);
  if (mTransportState != TRANSPORT_GONE) {
    final int newState=(isMusicPlaying(playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE);
    if (newState != mTransportState) {
      mTransportState=newState;
      if (DEBUGXPORT)       Log.v(TAG,"String_Node_Str");
      KeyguardHostView.this.post(mSwitchPageRunnable);
    }
  }
}
Program: 1929
Project: 1929
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  mPlaybackState=dcs.playbackState;
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ mPlaybackState);
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}
Program: 1930
Project: 1930
Buggy source:
@Override void onMusicClientIdChanged(int clientGeneration,boolean clearing,android.app.PendingIntent intent){
  if (DEBUGXPORT && (mClientGeneration != clientGeneration || clearing)) {
    Log.v(TAG,(clearing ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + clientGeneration);
  }
  mClientGeneration=clientGeneration;
  mTransportState=(clearing ? TRANSPORT_GONE : TRANSPORT_INVISIBLE);
  KeyguardHostView.this.post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override void onMusicClientIdChanged(int clientGeneration,boolean clearing,android.app.PendingIntent intent){
  if (DEBUGXPORT && (mClientGeneration != clientGeneration || clearing)) {
    Log.v(TAG,(clearing ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + clientGeneration);
  }
  mClientGeneration=clientGeneration;
  final int newState=(clearing ? TRANSPORT_GONE : (mTransportState == TRANSPORT_VISIBLE ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (newState != mTransportState) {
    mTransportState=newState;
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    KeyguardHostView.this.post(mSwitchPageRunnable);
  }
}
Program: 1931
Project: 1931
Buggy source:
@Override public void onMusicPlaybackStateChanged(int playbackState,long eventTime){
  mPlaybackState=playbackState;
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + playbackState);
  if (mTransportState != TRANSPORT_GONE) {
    mTransportState=(isMusicPlaying(mPlaybackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE);
  }
  KeyguardHostView.this.post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onMusicPlaybackStateChanged(int playbackState,long eventTime){
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + playbackState);
  if (mTransportState != TRANSPORT_GONE) {
    final int newState=(isMusicPlaying(playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE);
    if (newState != mTransportState) {
      mTransportState=newState;
      if (DEBUGXPORT)       Log.v(TAG,"String_Node_Str");
      KeyguardHostView.this.post(mSwitchPageRunnable);
    }
  }
}
Program: 1932
Project: 1932
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  mPlaybackState=dcs.playbackState;
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ mPlaybackState);
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}
Program: 1933
Project: 1933
Buggy source:
@Override void onMusicClientIdChanged(int clientGeneration,boolean clearing,android.app.PendingIntent intent){
  if (DEBUGXPORT && (mClientGeneration != clientGeneration || clearing)) {
    Log.v(TAG,(clearing ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + clientGeneration);
  }
  mClientGeneration=clientGeneration;
  mTransportState=(clearing ? TRANSPORT_GONE : TRANSPORT_INVISIBLE);
  KeyguardHostView.this.post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override void onMusicClientIdChanged(int clientGeneration,boolean clearing,android.app.PendingIntent intent){
  if (DEBUGXPORT && (mClientGeneration != clientGeneration || clearing)) {
    Log.v(TAG,(clearing ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + clientGeneration);
  }
  mClientGeneration=clientGeneration;
  final int newState=(clearing ? TRANSPORT_GONE : (mTransportState == TRANSPORT_VISIBLE ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (newState != mTransportState) {
    mTransportState=newState;
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    KeyguardHostView.this.post(mSwitchPageRunnable);
  }
}
Program: 1934
Project: 1934
Buggy source:
@Override public void onMusicPlaybackStateChanged(int playbackState,long eventTime){
  mPlaybackState=playbackState;
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + playbackState);
  if (mTransportState != TRANSPORT_GONE) {
    mTransportState=(isMusicPlaying(mPlaybackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE);
  }
  KeyguardHostView.this.post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onMusicPlaybackStateChanged(int playbackState,long eventTime){
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + playbackState);
  if (mTransportState != TRANSPORT_GONE) {
    final int newState=(isMusicPlaying(playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE);
    if (newState != mTransportState) {
      mTransportState=newState;
      if (DEBUGXPORT)       Log.v(TAG,"String_Node_Str");
      KeyguardHostView.this.post(mSwitchPageRunnable);
    }
  }
}
Program: 1935
Project: 1935
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  mPlaybackState=dcs.playbackState;
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ mPlaybackState);
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}
Program: 1936
Project: 1936
Buggy source:
@Override void onMusicClientIdChanged(int clientGeneration,boolean clearing,android.app.PendingIntent intent){
  if (DEBUGXPORT && (mClientGeneration != clientGeneration || clearing)) {
    Log.v(TAG,(clearing ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + clientGeneration);
  }
  mClientGeneration=clientGeneration;
  mTransportState=(clearing ? TRANSPORT_GONE : TRANSPORT_INVISIBLE);
  KeyguardHostView.this.post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override void onMusicClientIdChanged(int clientGeneration,boolean clearing,android.app.PendingIntent intent){
  if (DEBUGXPORT && (mClientGeneration != clientGeneration || clearing)) {
    Log.v(TAG,(clearing ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + clientGeneration);
  }
  mClientGeneration=clientGeneration;
  final int newState=(clearing ? TRANSPORT_GONE : (mTransportState == TRANSPORT_VISIBLE ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (newState != mTransportState) {
    mTransportState=newState;
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    KeyguardHostView.this.post(mSwitchPageRunnable);
  }
}
Program: 1937
Project: 1937
Buggy source:
@Override public void onMusicPlaybackStateChanged(int playbackState,long eventTime){
  mPlaybackState=playbackState;
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + playbackState);
  if (mTransportState != TRANSPORT_GONE) {
    mTransportState=(isMusicPlaying(mPlaybackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE);
  }
  KeyguardHostView.this.post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onMusicPlaybackStateChanged(int playbackState,long eventTime){
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + playbackState);
  if (mTransportState != TRANSPORT_GONE) {
    final int newState=(isMusicPlaying(playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE);
    if (newState != mTransportState) {
      mTransportState=newState;
      if (DEBUGXPORT)       Log.v(TAG,"String_Node_Str");
      KeyguardHostView.this.post(mSwitchPageRunnable);
    }
  }
}
Program: 1942
Project: 1942
Buggy source:
/** 
 * Set whether SELinux is permissive or enforcing.
 * @param boolean representing whether to set SELinux to enforcing
 * @return a boolean representing whether the desired mode was set
 */
public static final native boolean setSELinuxEnforce(boolean value);

Fixed version (ground truth):
/** 
 * Set whether SELinux is permissive or enforcing.
 * @param value representing whether to set SELinux to enforcing
 * @return a boolean representing whether the desired mode was set
 */
public static final native boolean setSELinuxEnforce(boolean value);
Program: 1943
Project: 1943
Buggy source:
/** 
 * Gets the security context of a given process id. Use of this function is discouraged for Binder transactions. Use Binder.getCallingSecctx() instead.
 * @param pid an int representing the process id to check.
 * @return a String representing the security context of the given pid.
 */
public static final native String getPidContext(int pid);

Fixed version (ground truth):
/** 
 * Gets the security context of a given process id.
 * @param pid an int representing the process id to check.
 * @return a String representing the security context of the given pid.
 */
public static final native String getPidContext(int pid);
Program: 1944
Project: 1944
Buggy source:
/** 
 * Sets the value for the given SELinux boolean name.
 * @param String The name of the SELinux boolean.
 * @param Boolean The new value of the SELinux boolean.
 * @return a boolean indicating whether or not the operation succeeded.
 */
public static final native boolean setBooleanValue(String name,boolean value);

Fixed version (ground truth):
/** 
 * Sets the value for the given SELinux boolean name.
 * @param name The name of the SELinux boolean.
 * @param value The new value of the SELinux boolean.
 * @return a boolean indicating whether or not the operation succeeded.
 */
public static final native boolean setBooleanValue(String name,boolean value);