nus-yam/ex-repair huggingface dataset:
Program: 41352
Project: 41352
Buggy source:
protected void onDataSetupComplete(AsyncResult ar){
  String reason=null;
  if (ar.userObj instanceof String) {
    reason=(String)ar.userObj;
  }
  if (ar.exception == null) {
    if (isApnTypeActive(Phone.APN_TYPE_DEFAULT)) {
      SystemProperties.set("String_Node_Str","String_Node_Str");
      if (canSetPreferApn && preferredApn == null) {
        Log.d(LOG_TAG,"String_Node_Str");
        preferredApn=mActiveApn;
        setPreferredApn(preferredApn.id);
      }
    }
 else {
      SystemProperties.set("String_Node_Str","String_Node_Str");
    }
    notifyDefaultData(reason);
  }
 else {
    GsmDataConnection.FailCause cause;
    cause=(GsmDataConnection.FailCause)(ar.result);
    if (DBG)     log("String_Node_Str" + cause);
    if (cause.isEventLoggable()) {
      GsmCellLocation loc=((GsmCellLocation)phone.getCellLocation());
      EventLog.writeEvent(EventLogTags.PDP_SETUP_FAIL,cause.ordinal(),loc != null ? loc.getCid() : -1,TelephonyManager.getDefault().getNetworkType());
    }
    if (cause.isPermanentFail()) {
      notifyNoData(cause);
      if (!mRequestedApnType.equals(Phone.APN_TYPE_DEFAULT)) {
        phone.notifyDataConnection(Phone.REASON_APN_FAILED);
        onEnableApn(apnTypeToId(mRequestedApnType),DISABLED);
      }
      return;
    }
    waitingApns.remove(0);
    if (waitingApns.isEmpty()) {
      startDelayedRetry(cause,reason);
    }
 else {
      setState(State.SCANNING);
      sendMessageDelayed(obtainMessage(EVENT_TRY_SETUP_DATA,reason),APN_DELAY_MILLIS);
    }
  }
}

Fixed version (ground truth):
protected void onDataSetupComplete(AsyncResult ar){
  String reason=null;
  if (ar.userObj instanceof String) {
    reason=(String)ar.userObj;
  }
  if (ar.exception == null) {
    if (isApnTypeActive(Phone.APN_TYPE_DEFAULT)) {
      SystemProperties.set("String_Node_Str","String_Node_Str");
      if (canSetPreferApn && preferredApn == null) {
        Log.d(LOG_TAG,"String_Node_Str");
        preferredApn=mActiveApn;
        setPreferredApn(preferredApn.id);
      }
    }
 else {
      SystemProperties.set("String_Node_Str","String_Node_Str");
    }
    notifyDefaultData(reason);
  }
 else {
    GsmDataConnection.FailCause cause;
    cause=(GsmDataConnection.FailCause)(ar.result);
    if (DBG)     log("String_Node_Str" + cause);
    if (cause.isEventLoggable()) {
      GsmCellLocation loc=((GsmCellLocation)phone.getCellLocation());
      EventLog.writeEvent(EventLogTags.PDP_SETUP_FAIL,cause.ordinal(),loc != null ? loc.getCid() : -1,TelephonyManager.getDefault().getNetworkType());
    }
    if (cause.isPermanentFail()) {
      notifyNoData(cause);
      phone.notifyDataConnection(Phone.REASON_APN_FAILED);
      onEnableApn(apnTypeToId(mRequestedApnType),DISABLED);
      return;
    }
    waitingApns.remove(0);
    if (waitingApns.isEmpty()) {
      startDelayedRetry(cause,reason);
    }
 else {
      setState(State.SCANNING);
      sendMessageDelayed(obtainMessage(EVENT_TRY_SETUP_DATA,reason),APN_DELAY_MILLIS);
    }
  }
}
Program: 41353
Project: 41353
Buggy source:
protected void onDataSetupComplete(AsyncResult ar){
  String reason=null;
  if (ar.userObj instanceof String) {
    reason=(String)ar.userObj;
  }
  if (ar.exception == null) {
    if (isApnTypeActive(Phone.APN_TYPE_DEFAULT)) {
      SystemProperties.set("String_Node_Str","String_Node_Str");
      if (canSetPreferApn && preferredApn == null) {
        Log.d(LOG_TAG,"String_Node_Str");
        preferredApn=mActiveApn;
        setPreferredApn(preferredApn.id);
      }
    }
 else {
      SystemProperties.set("String_Node_Str","String_Node_Str");
    }
    notifyDefaultData(reason);
  }
 else {
    GsmDataConnection.FailCause cause;
    cause=(GsmDataConnection.FailCause)(ar.result);
    if (DBG)     log("String_Node_Str" + cause);
    if (cause.isEventLoggable()) {
      GsmCellLocation loc=((GsmCellLocation)phone.getCellLocation());
      EventLog.writeEvent(EventLogTags.PDP_SETUP_FAIL,cause.ordinal(),loc != null ? loc.getCid() : -1,TelephonyManager.getDefault().getNetworkType());
    }
    if (cause.isPermanentFail()) {
      notifyNoData(cause);
      if (!mRequestedApnType.equals(Phone.APN_TYPE_DEFAULT)) {
        phone.notifyDataConnection(Phone.REASON_APN_FAILED);
        onEnableApn(apnTypeToId(mRequestedApnType),DISABLED);
      }
      return;
    }
    waitingApns.remove(0);
    if (waitingApns.isEmpty()) {
      startDelayedRetry(cause,reason);
    }
 else {
      setState(State.SCANNING);
      sendMessageDelayed(obtainMessage(EVENT_TRY_SETUP_DATA,reason),APN_DELAY_MILLIS);
    }
  }
}

Fixed version (ground truth):
protected void onDataSetupComplete(AsyncResult ar){
  String reason=null;
  if (ar.userObj instanceof String) {
    reason=(String)ar.userObj;
  }
  if (ar.exception == null) {
    if (isApnTypeActive(Phone.APN_TYPE_DEFAULT)) {
      SystemProperties.set("String_Node_Str","String_Node_Str");
      if (canSetPreferApn && preferredApn == null) {
        Log.d(LOG_TAG,"String_Node_Str");
        preferredApn=mActiveApn;
        setPreferredApn(preferredApn.id);
      }
    }
 else {
      SystemProperties.set("String_Node_Str","String_Node_Str");
    }
    notifyDefaultData(reason);
  }
 else {
    GsmDataConnection.FailCause cause;
    cause=(GsmDataConnection.FailCause)(ar.result);
    if (DBG)     log("String_Node_Str" + cause);
    if (cause.isEventLoggable()) {
      GsmCellLocation loc=((GsmCellLocation)phone.getCellLocation());
      EventLog.writeEvent(EventLogTags.PDP_SETUP_FAIL,cause.ordinal(),loc != null ? loc.getCid() : -1,TelephonyManager.getDefault().getNetworkType());
    }
    if (cause.isPermanentFail()) {
      notifyNoData(cause);
      phone.notifyDataConnection(Phone.REASON_APN_FAILED);
      onEnableApn(apnTypeToId(mRequestedApnType),DISABLED);
      return;
    }
    waitingApns.remove(0);
    if (waitingApns.isEmpty()) {
      startDelayedRetry(cause,reason);
    }
 else {
      setState(State.SCANNING);
      sendMessageDelayed(obtainMessage(EVENT_TRY_SETUP_DATA,reason),APN_DELAY_MILLIS);
    }
  }
}
Program: 41355
Project: 41355
Buggy source:
/** 
 * @hide Just for debugging; not internationalized. 
 */
public static void formatDuration(long time,long now,PrintWriter pw){
  if (time == 0) {
    pw.print("String_Node_Str");
    return;
  }
  formatDuration(time - now,pw);
}

Fixed version (ground truth):
/** 
 * @hide Just for debugging; not internationalized. 
 */
public static void formatDuration(long time,long now,PrintWriter pw){
  if (time == 0) {
    pw.print("String_Node_Str");
    return;
  }
  formatDuration(time - now,pw,0);
}
Program: 41357
Project: 41357
Buggy source:
/** 
 * @hide Just for debugging; not internationalized. 
 */
public static void formatDuration(long time,long now,PrintWriter pw){
  if (time == 0) {
    pw.print("String_Node_Str");
    return;
  }
  formatDuration(time - now,pw);
}

Fixed version (ground truth):
/** 
 * @hide Just for debugging; not internationalized. 
 */
public static void formatDuration(long time,long now,PrintWriter pw){
  if (time == 0) {
    pw.print("String_Node_Str");
    return;
  }
  formatDuration(time - now,pw,0);
}
Program: 41358
Project: 41358
Buggy source:
void edgeReached(int delta){
  mScroller.notifyVerticalEdgeReached(mScrollY,0,mOverflingDistance);
  mTouchMode=TOUCH_MODE_OVERFLING;
  if (mEdgeGlowTop != null) {
    final int vel=(int)mScroller.getCurrVelocity();
    if (delta > 0) {
      mEdgeGlowTop.onAbsorb(vel);
    }
 else {
      mEdgeGlowBottom.onAbsorb(vel);
    }
  }
  invalidate();
  post(this);
}

Fixed version (ground truth):
void edgeReached(int delta){
  mScroller.notifyVerticalEdgeReached(mScrollY,0,mOverflingDistance);
  final int overscrollMode=getOverscrollMode();
  if (overscrollMode == OVERSCROLL_ALWAYS || (overscrollMode == OVERSCROLL_IF_CONTENT_SCROLLS && !contentFits())) {
    mTouchMode=TOUCH_MODE_OVERFLING;
    final int vel=(int)mScroller.getCurrVelocity();
    if (delta > 0) {
      mEdgeGlowTop.onAbsorb(vel);
    }
 else {
      mEdgeGlowBottom.onAbsorb(vel);
    }
  }
  invalidate();
  post(this);
}
Program: 41361
Project: 41361
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (oldX != x || oldY != y) {
      overscrollBy(x - oldX,y - oldY,oldX,oldY,getScrollRange(),0,mOverflingDistance,0,false);
      onScrollChanged(mScrollX,mScrollY,oldX,oldY);
      final int range=getScrollRange();
      if (x < 0 && oldX >= 0) {
        mEdgeGlowLeft.onAbsorb((int)mScroller.getCurrVelocity());
      }
 else       if (x > range && oldX <= range) {
        mEdgeGlowRight.onAbsorb((int)mScroller.getCurrVelocity());
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}

Fixed version (ground truth):
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (oldX != x || oldY != y) {
      overscrollBy(x - oldX,y - oldY,oldX,oldY,getScrollRange(),0,mOverflingDistance,0,false);
      onScrollChanged(mScrollX,mScrollY,oldX,oldY);
      final int range=getScrollRange();
      final int overscrollMode=getOverscrollMode();
      if (overscrollMode == OVERSCROLL_ALWAYS || (overscrollMode == OVERSCROLL_IF_CONTENT_SCROLLS && range > 0)) {
        if (x < 0 && oldX >= 0) {
          mEdgeGlowLeft.onAbsorb((int)mScroller.getCurrVelocity());
        }
 else         if (x > range && oldX <= range) {
          mEdgeGlowRight.onAbsorb((int)mScroller.getCurrVelocity());
        }
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41363
Project: 41363
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (oldX != x || oldY != y) {
      overscrollBy(x - oldX,y - oldY,oldX,oldY,0,getScrollRange(),0,mOverflingDistance,false);
      onScrollChanged(mScrollX,mScrollY,oldX,oldY);
      final int range=getScrollRange();
      if (y < 0 && oldY >= 0) {
        mEdgeGlowTop.onAbsorb((int)mScroller.getCurrVelocity());
      }
 else       if (y > range && oldY <= range) {
        mEdgeGlowBottom.onAbsorb((int)mScroller.getCurrVelocity());
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}

Fixed version (ground truth):
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (oldX != x || oldY != y) {
      overscrollBy(x - oldX,y - oldY,oldX,oldY,0,getScrollRange(),0,mOverflingDistance,false);
      onScrollChanged(mScrollX,mScrollY,oldX,oldY);
      final int range=getScrollRange();
      final int overscrollMode=getOverscrollMode();
      if (overscrollMode == OVERSCROLL_ALWAYS || (overscrollMode == OVERSCROLL_IF_CONTENT_SCROLLS && range > 0)) {
        if (y < 0 && oldY >= 0) {
          mEdgeGlowTop.onAbsorb((int)mScroller.getCurrVelocity());
        }
 else         if (y > range && oldY <= range) {
          mEdgeGlowBottom.onAbsorb((int)mScroller.getCurrVelocity());
        }
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41364
Project: 41364
Buggy source:
void edgeReached(int delta){
  mScroller.notifyVerticalEdgeReached(mScrollY,0,mOverflingDistance);
  mTouchMode=TOUCH_MODE_OVERFLING;
  if (mEdgeGlowTop != null) {
    final int vel=(int)mScroller.getCurrVelocity();
    if (delta > 0) {
      mEdgeGlowTop.onAbsorb(vel);
    }
 else {
      mEdgeGlowBottom.onAbsorb(vel);
    }
  }
  invalidate();
  post(this);
}

Fixed version (ground truth):
void edgeReached(int delta){
  mScroller.notifyVerticalEdgeReached(mScrollY,0,mOverflingDistance);
  final int overscrollMode=getOverscrollMode();
  if (overscrollMode == OVERSCROLL_ALWAYS || (overscrollMode == OVERSCROLL_IF_CONTENT_SCROLLS && !contentFits())) {
    mTouchMode=TOUCH_MODE_OVERFLING;
    final int vel=(int)mScroller.getCurrVelocity();
    if (delta > 0) {
      mEdgeGlowTop.onAbsorb(vel);
    }
 else {
      mEdgeGlowBottom.onAbsorb(vel);
    }
  }
  invalidate();
  post(this);
}
Program: 41367
Project: 41367
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (oldX != x || oldY != y) {
      overscrollBy(x - oldX,y - oldY,oldX,oldY,getScrollRange(),0,mOverflingDistance,0,false);
      onScrollChanged(mScrollX,mScrollY,oldX,oldY);
      final int range=getScrollRange();
      if (x < 0 && oldX >= 0) {
        mEdgeGlowLeft.onAbsorb((int)mScroller.getCurrVelocity());
      }
 else       if (x > range && oldX <= range) {
        mEdgeGlowRight.onAbsorb((int)mScroller.getCurrVelocity());
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}

Fixed version (ground truth):
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (oldX != x || oldY != y) {
      overscrollBy(x - oldX,y - oldY,oldX,oldY,getScrollRange(),0,mOverflingDistance,0,false);
      onScrollChanged(mScrollX,mScrollY,oldX,oldY);
      final int range=getScrollRange();
      final int overscrollMode=getOverscrollMode();
      if (overscrollMode == OVERSCROLL_ALWAYS || (overscrollMode == OVERSCROLL_IF_CONTENT_SCROLLS && range > 0)) {
        if (x < 0 && oldX >= 0) {
          mEdgeGlowLeft.onAbsorb((int)mScroller.getCurrVelocity());
        }
 else         if (x > range && oldX <= range) {
          mEdgeGlowRight.onAbsorb((int)mScroller.getCurrVelocity());
        }
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41369
Project: 41369
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (oldX != x || oldY != y) {
      overscrollBy(x - oldX,y - oldY,oldX,oldY,0,getScrollRange(),0,mOverflingDistance,false);
      onScrollChanged(mScrollX,mScrollY,oldX,oldY);
      final int range=getScrollRange();
      if (y < 0 && oldY >= 0) {
        mEdgeGlowTop.onAbsorb((int)mScroller.getCurrVelocity());
      }
 else       if (y > range && oldY <= range) {
        mEdgeGlowBottom.onAbsorb((int)mScroller.getCurrVelocity());
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}

Fixed version (ground truth):
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (oldX != x || oldY != y) {
      overscrollBy(x - oldX,y - oldY,oldX,oldY,0,getScrollRange(),0,mOverflingDistance,false);
      onScrollChanged(mScrollX,mScrollY,oldX,oldY);
      final int range=getScrollRange();
      final int overscrollMode=getOverscrollMode();
      if (overscrollMode == OVERSCROLL_ALWAYS || (overscrollMode == OVERSCROLL_IF_CONTENT_SCROLLS && range > 0)) {
        if (y < 0 && oldY >= 0) {
          mEdgeGlowTop.onAbsorb((int)mScroller.getCurrVelocity());
        }
 else         if (y > range && oldY <= range) {
          mEdgeGlowBottom.onAbsorb((int)mScroller.getCurrVelocity());
        }
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41370
Project: 41370
Buggy source:
private boolean deleteSystemPackageLI(PackageParser.Package p,int flags,PackageRemovedInfo outInfo){
  ApplicationInfo applicationInfo=p.applicationInfo;
  if (applicationInfo == null) {
    Slog.w(TAG,"String_Node_Str" + p.packageName + "String_Node_Str");
    return false;
  }
  PackageSetting ps=null;
synchronized (mPackages) {
    ps=mSettings.getDisabledSystemPkg(p.packageName);
  }
  if (ps == null) {
    Slog.w(TAG,"String_Node_Str" + p.packageName);
    return false;
  }
 else {
    Log.i(TAG,"String_Node_Str");
  }
  outInfo.isRemovedPackageSystemUpdate=true;
  boolean deleteCodeAndResources=false;
  if (ps.versionCode < p.mVersionCode) {
    deleteCodeAndResources=true;
    if ((flags & PackageManager.DONT_DELETE_DATA) == 0) {
      flags&=~PackageManager.DONT_DELETE_DATA;
    }
  }
 else {
    if ((flags & PackageManager.DONT_DELETE_DATA) == 0) {
      flags|=PackageManager.DONT_DELETE_DATA;
    }
  }
  boolean ret=deleteInstalledPackageLI(p,deleteCodeAndResources,flags,outInfo);
  if (!ret) {
    return false;
  }
synchronized (mPackages) {
    mSettings.enableSystemPackageLP(p.packageName);
    removeNativeBinariesLI(p);
  }
  PackageParser.Package newPkg=scanPackageLI(ps.codePath,PackageParser.PARSE_MUST_BE_APK | PackageParser.PARSE_IS_SYSTEM,SCAN_MONITOR | SCAN_NO_PATHS);
  if (newPkg == null) {
    Slog.w(TAG,"String_Node_Str" + p.packageName + "String_Node_Str"+ mLastScanError);
    return false;
  }
synchronized (mPackages) {
    updatePermissionsLP(newPkg.packageName,newPkg,true,true,false);
    mSettings.writeLP();
  }
  return true;
}

Fixed version (ground truth):
private boolean deleteSystemPackageLI(PackageParser.Package p,int flags,PackageRemovedInfo outInfo){
  ApplicationInfo applicationInfo=p.applicationInfo;
  if (applicationInfo == null) {
    Slog.w(TAG,"String_Node_Str" + p.packageName + "String_Node_Str");
    return false;
  }
  PackageSetting ps=null;
synchronized (mPackages) {
    ps=mSettings.getDisabledSystemPkg(p.packageName);
  }
  if (ps == null) {
    Slog.w(TAG,"String_Node_Str" + p.packageName);
    return false;
  }
 else {
    Log.i(TAG,"String_Node_Str");
  }
  outInfo.isRemovedPackageSystemUpdate=true;
  final boolean deleteCodeAndResources;
  if (ps.versionCode < p.mVersionCode) {
    deleteCodeAndResources=true;
    flags&=~PackageManager.DONT_DELETE_DATA;
  }
 else {
    deleteCodeAndResources=false;
    flags|=PackageManager.DONT_DELETE_DATA;
  }
  boolean ret=deleteInstalledPackageLI(p,deleteCodeAndResources,flags,outInfo);
  if (!ret) {
    return false;
  }
synchronized (mPackages) {
    mSettings.enableSystemPackageLP(p.packageName);
    removeNativeBinariesLI(p);
  }
  PackageParser.Package newPkg=scanPackageLI(ps.codePath,PackageParser.PARSE_MUST_BE_APK | PackageParser.PARSE_IS_SYSTEM,SCAN_MONITOR | SCAN_NO_PATHS);
  if (newPkg == null) {
    Slog.w(TAG,"String_Node_Str" + p.packageName + "String_Node_Str"+ mLastScanError);
    return false;
  }
synchronized (mPackages) {
    updatePermissionsLP(newPkg.packageName,newPkg,true,true,false);
    mSettings.writeLP();
  }
  return true;
}
Program: 41371
Project: 41371
Buggy source:
public void run(){
  if (mDataChanged) {
    post(this);
  }
 else {
    fireOnSelected();
  }
}

Fixed version (ground truth):
public void run(){
  if (mDataChanged) {
    if (getAdapter() != null) {
      post(this);
    }
  }
 else {
    fireOnSelected();
  }
}
Program: 41372
Project: 41372
Buggy source:
@Override public void onInvalidated(){
  mDataChanged=true;
  if (AdapterView.this.getAdapter().hasStableIds()) {
    mInstanceState=AdapterView.this.onSaveInstanceState();
  }
  mOldItemCount=mItemCount;
  mItemCount=0;
  mSelectedPosition=INVALID_POSITION;
  mSelectedRowId=INVALID_ROW_ID;
  mNextSelectedPosition=INVALID_POSITION;
  mNextSelectedRowId=INVALID_ROW_ID;
  mNeedSync=false;
  checkSelectionChanged();
  checkFocus();
  requestLayout();
}

Fixed version (ground truth):
@Override public void onInvalidated(){
  mDataChanged=true;
  if (AdapterView.this.getAdapter().hasStableIds()) {
    mInstanceState=AdapterView.this.onSaveInstanceState();
  }
  mOldItemCount=mItemCount;
  mItemCount=0;
  mSelectedPosition=INVALID_POSITION;
  mSelectedRowId=INVALID_ROW_ID;
  mNextSelectedPosition=INVALID_POSITION;
  mNextSelectedRowId=INVALID_ROW_ID;
  mNeedSync=false;
  checkFocus();
  requestLayout();
}
Program: 41373
Project: 41373
Buggy source:
void selectionChanged(){
  if (mOnItemSelectedListener != null) {
    if (mInLayout || mBlockLayoutRequests) {
      if (mSelectionNotifier == null) {
        mSelectionNotifier=new SelectionNotifier();
      }
      mSelectionNotifier.post(mSelectionNotifier);
    }
 else {
      fireOnSelected();
    }
  }
  if (mSelectedPosition != ListView.INVALID_POSITION && isShown() && !isInTouchMode()) {
    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
  }
}

Fixed version (ground truth):
void selectionChanged(){
  if (mOnItemSelectedListener != null) {
    if (mInLayout || mBlockLayoutRequests) {
      if (mSelectionNotifier == null) {
        mSelectionNotifier=new SelectionNotifier();
      }
      post(mSelectionNotifier);
    }
 else {
      fireOnSelected();
    }
  }
  if (mSelectedPosition != ListView.INVALID_POSITION && isShown() && !isInTouchMode()) {
    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
  }
}
Program: 41374
Project: 41374
Buggy source:
public void run(){
  if (mDataChanged) {
    post(this);
  }
 else {
    fireOnSelected();
  }
}

Fixed version (ground truth):
public void run(){
  if (mDataChanged) {
    if (getAdapter() != null) {
      post(this);
    }
  }
 else {
    fireOnSelected();
  }
}
Program: 41375
Project: 41375
Buggy source:
@Override public void onInvalidated(){
  mDataChanged=true;
  if (AdapterView.this.getAdapter().hasStableIds()) {
    mInstanceState=AdapterView.this.onSaveInstanceState();
  }
  mOldItemCount=mItemCount;
  mItemCount=0;
  mSelectedPosition=INVALID_POSITION;
  mSelectedRowId=INVALID_ROW_ID;
  mNextSelectedPosition=INVALID_POSITION;
  mNextSelectedRowId=INVALID_ROW_ID;
  mNeedSync=false;
  checkSelectionChanged();
  checkFocus();
  requestLayout();
}

Fixed version (ground truth):
@Override public void onInvalidated(){
  mDataChanged=true;
  if (AdapterView.this.getAdapter().hasStableIds()) {
    mInstanceState=AdapterView.this.onSaveInstanceState();
  }
  mOldItemCount=mItemCount;
  mItemCount=0;
  mSelectedPosition=INVALID_POSITION;
  mSelectedRowId=INVALID_ROW_ID;
  mNextSelectedPosition=INVALID_POSITION;
  mNextSelectedRowId=INVALID_ROW_ID;
  mNeedSync=false;
  checkFocus();
  requestLayout();
}
Program: 41376
Project: 41376
Buggy source:
void selectionChanged(){
  if (mOnItemSelectedListener != null) {
    if (mInLayout || mBlockLayoutRequests) {
      if (mSelectionNotifier == null) {
        mSelectionNotifier=new SelectionNotifier();
      }
      mSelectionNotifier.post(mSelectionNotifier);
    }
 else {
      fireOnSelected();
    }
  }
  if (mSelectedPosition != ListView.INVALID_POSITION && isShown() && !isInTouchMode()) {
    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
  }
}

Fixed version (ground truth):
void selectionChanged(){
  if (mOnItemSelectedListener != null) {
    if (mInLayout || mBlockLayoutRequests) {
      if (mSelectionNotifier == null) {
        mSelectionNotifier=new SelectionNotifier();
      }
      post(mSelectionNotifier);
    }
 else {
      fireOnSelected();
    }
  }
  if (mSelectedPosition != ListView.INVALID_POSITION && isShown() && !isInTouchMode()) {
    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
  }
}
Program: 41377
Project: 41377
Buggy source:
/** 
 * Sets the maximum and maximum preview fps. This controls the rate of preview frames received in   {@link #PreviewCallback}. The minimum and maximum preview fps must be one of the elements from   {@link #getSupportedPreviewFpsRange}.
 * @param min the minimum preview fps (scaled by 1000).
 * @param max the maximum preview fps (scaled by 1000).
 * @throws RuntimeException if fps range is invalid.
 * @see #setPreviewCallbackWithBuffer(Camera.PreviewCallback)
 * @see #getSupportedPreviewFpsRange()
 */
public void setPreviewFpsRange(int min,int max){
  set(KEY_PREVIEW_FPS_RANGE,"String_Node_Str" + min + "String_Node_Str"+ max);
}

Fixed version (ground truth):
/** 
 * Sets the maximum and maximum preview fps. This controls the rate of preview frames received in   {@link PreviewCallback}. The minimum and maximum preview fps must be one of the elements from   {@link #getSupportedPreviewFpsRange}.
 * @param min the minimum preview fps (scaled by 1000).
 * @param max the maximum preview fps (scaled by 1000).
 * @throws RuntimeException if fps range is invalid.
 * @see #setPreviewCallbackWithBuffer(Camera.PreviewCallback)
 * @see #getSupportedPreviewFpsRange()
 */
public void setPreviewFpsRange(int min,int max){
  set(KEY_PREVIEW_FPS_RANGE,"String_Node_Str" + min + "String_Node_Str"+ max);
}
Program: 41378
Project: 41378
Buggy source:
@Override public int update(Uri url,ContentValues initialValues,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  sKnownMutationsInFlight.decrementAndGet();
  int count=db.update(args.table,initialValues,args.where,args.args);
  if (count > 0) {
    SettingsCache.wipe(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str"+ initialValues);
  return count;
}

Fixed version (ground truth):
@Override public int update(Uri url,ContentValues initialValues,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  int count=db.update(args.table,initialValues,args.where,args.args);
  sKnownMutationsInFlight.decrementAndGet();
  if (count > 0) {
    SettingsCache.invalidate(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str"+ initialValues);
  return count;
}
Program: 41379
Project: 41379
Buggy source:
private void fullyPopulateCache(String table,SettingsCache cache){
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor c=db.query(table,new String[]{Settings.NameValueTable.NAME,Settings.NameValueTable.VALUE},null,null,null,null,null,"String_Node_Str" + (MAX_CACHE_ENTRIES + 1));
  try {
synchronized (cache) {
      cache.clear();
      cache.setFullyMatchesDisk(true);
      int rows=0;
      while (c.moveToNext()) {
        rows++;
        String name=c.getString(0);
        String value=c.getString(1);
        cache.populate(name,value);
      }
      if (rows > MAX_CACHE_ENTRIES) {
        cache.setFullyMatchesDisk(false);
        Log.d(TAG,"String_Node_Str" + table);
      }
      Log.d(TAG,"String_Node_Str" + table + "String_Node_Str"+ cache.fullyMatchesDisk());
    }
  }
  finally {
    c.close();
  }
}

Fixed version (ground truth):
private void fullyPopulateCache(String table,SettingsCache cache){
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor c=db.query(table,new String[]{Settings.NameValueTable.NAME,Settings.NameValueTable.VALUE},null,null,null,null,null,"String_Node_Str" + (MAX_CACHE_ENTRIES + 1));
  try {
synchronized (cache) {
      cache.clear();
      cache.setFullyMatchesDisk(true);
      int rows=0;
      while (c.moveToNext()) {
        rows++;
        String name=c.getString(0);
        String value=c.getString(1);
        cache.populate(name,value);
      }
      if (rows > MAX_CACHE_ENTRIES) {
        cache.setFullyMatchesDisk(false);
        Log.d(TAG,"String_Node_Str" + table);
      }
      Log.d(TAG,"String_Node_Str" + table + "String_Node_Str"+ rows+ "String_Node_Str"+ cache.fullyMatchesDisk());
    }
  }
  finally {
    c.close();
  }
}
Program: 41380
Project: 41380
Buggy source:
@Override public int delete(Uri url,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
 else   if (TABLE_OLD_FAVORITES.equals(args.table)) {
    args.table=TABLE_FAVORITES;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  int count=db.delete(args.table,args.where,args.args);
  sKnownMutationsInFlight.decrementAndGet();
  if (count > 0) {
    SettingsCache.wipe(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str");
  return count;
}

Fixed version (ground truth):
@Override public int delete(Uri url,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
 else   if (TABLE_OLD_FAVORITES.equals(args.table)) {
    args.table=TABLE_FAVORITES;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  int count=db.delete(args.table,args.where,args.args);
  sKnownMutationsInFlight.decrementAndGet();
  if (count > 0) {
    SettingsCache.invalidate(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str");
  return count;
}
Program: 41381
Project: 41381
Buggy source:
@Override public int update(Uri url,ContentValues initialValues,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  sKnownMutationsInFlight.decrementAndGet();
  int count=db.update(args.table,initialValues,args.where,args.args);
  if (count > 0) {
    SettingsCache.wipe(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str"+ initialValues);
  return count;
}

Fixed version (ground truth):
@Override public int update(Uri url,ContentValues initialValues,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  int count=db.update(args.table,initialValues,args.where,args.args);
  sKnownMutationsInFlight.decrementAndGet();
  if (count > 0) {
    SettingsCache.invalidate(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str"+ initialValues);
  return count;
}
Program: 41382
Project: 41382
Buggy source:
private void fullyPopulateCache(String table,SettingsCache cache){
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor c=db.query(table,new String[]{Settings.NameValueTable.NAME,Settings.NameValueTable.VALUE},null,null,null,null,null,"String_Node_Str" + (MAX_CACHE_ENTRIES + 1));
  try {
synchronized (cache) {
      cache.clear();
      cache.setFullyMatchesDisk(true);
      int rows=0;
      while (c.moveToNext()) {
        rows++;
        String name=c.getString(0);
        String value=c.getString(1);
        cache.populate(name,value);
      }
      if (rows > MAX_CACHE_ENTRIES) {
        cache.setFullyMatchesDisk(false);
        Log.d(TAG,"String_Node_Str" + table);
      }
      Log.d(TAG,"String_Node_Str" + table + "String_Node_Str"+ cache.fullyMatchesDisk());
    }
  }
  finally {
    c.close();
  }
}

Fixed version (ground truth):
private void fullyPopulateCache(String table,SettingsCache cache){
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor c=db.query(table,new String[]{Settings.NameValueTable.NAME,Settings.NameValueTable.VALUE},null,null,null,null,null,"String_Node_Str" + (MAX_CACHE_ENTRIES + 1));
  try {
synchronized (cache) {
      cache.clear();
      cache.setFullyMatchesDisk(true);
      int rows=0;
      while (c.moveToNext()) {
        rows++;
        String name=c.getString(0);
        String value=c.getString(1);
        cache.populate(name,value);
      }
      if (rows > MAX_CACHE_ENTRIES) {
        cache.setFullyMatchesDisk(false);
        Log.d(TAG,"String_Node_Str" + table);
      }
      Log.d(TAG,"String_Node_Str" + table + "String_Node_Str"+ rows+ "String_Node_Str"+ cache.fullyMatchesDisk());
    }
  }
  finally {
    c.close();
  }
}
Program: 41383
Project: 41383
Buggy source:
@Override public int delete(Uri url,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
 else   if (TABLE_OLD_FAVORITES.equals(args.table)) {
    args.table=TABLE_FAVORITES;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  int count=db.delete(args.table,args.where,args.args);
  sKnownMutationsInFlight.decrementAndGet();
  if (count > 0) {
    SettingsCache.wipe(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str");
  return count;
}

Fixed version (ground truth):
@Override public int delete(Uri url,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
 else   if (TABLE_OLD_FAVORITES.equals(args.table)) {
    args.table=TABLE_FAVORITES;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  int count=db.delete(args.table,args.where,args.args);
  sKnownMutationsInFlight.decrementAndGet();
  if (count > 0) {
    SettingsCache.invalidate(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str");
  return count;
}
Program: 41385
Project: 41385
Buggy source:
@Override public int update(Uri url,ContentValues initialValues,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  sKnownMutationsInFlight.decrementAndGet();
  int count=db.update(args.table,initialValues,args.where,args.args);
  if (count > 0) {
    SettingsCache.wipe(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str"+ initialValues);
  return count;
}

Fixed version (ground truth):
@Override public int update(Uri url,ContentValues initialValues,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  int count=db.update(args.table,initialValues,args.where,args.args);
  sKnownMutationsInFlight.decrementAndGet();
  if (count > 0) {
    SettingsCache.invalidate(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str"+ initialValues);
  return count;
}
Program: 41386
Project: 41386
Buggy source:
private void fullyPopulateCache(String table,SettingsCache cache){
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor c=db.query(table,new String[]{Settings.NameValueTable.NAME,Settings.NameValueTable.VALUE},null,null,null,null,null,"String_Node_Str" + (MAX_CACHE_ENTRIES + 1));
  try {
synchronized (cache) {
      cache.clear();
      cache.setFullyMatchesDisk(true);
      int rows=0;
      while (c.moveToNext()) {
        rows++;
        String name=c.getString(0);
        String value=c.getString(1);
        cache.populate(name,value);
      }
      if (rows > MAX_CACHE_ENTRIES) {
        cache.setFullyMatchesDisk(false);
        Log.d(TAG,"String_Node_Str" + table);
      }
      Log.d(TAG,"String_Node_Str" + table + "String_Node_Str"+ cache.fullyMatchesDisk());
    }
  }
  finally {
    c.close();
  }
}

Fixed version (ground truth):
private void fullyPopulateCache(String table,SettingsCache cache){
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor c=db.query(table,new String[]{Settings.NameValueTable.NAME,Settings.NameValueTable.VALUE},null,null,null,null,null,"String_Node_Str" + (MAX_CACHE_ENTRIES + 1));
  try {
synchronized (cache) {
      cache.clear();
      cache.setFullyMatchesDisk(true);
      int rows=0;
      while (c.moveToNext()) {
        rows++;
        String name=c.getString(0);
        String value=c.getString(1);
        cache.populate(name,value);
      }
      if (rows > MAX_CACHE_ENTRIES) {
        cache.setFullyMatchesDisk(false);
        Log.d(TAG,"String_Node_Str" + table);
      }
      Log.d(TAG,"String_Node_Str" + table + "String_Node_Str"+ rows+ "String_Node_Str"+ cache.fullyMatchesDisk());
    }
  }
  finally {
    c.close();
  }
}
Program: 41387
Project: 41387
Buggy source:
@Override public int delete(Uri url,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
 else   if (TABLE_OLD_FAVORITES.equals(args.table)) {
    args.table=TABLE_FAVORITES;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  int count=db.delete(args.table,args.where,args.args);
  sKnownMutationsInFlight.decrementAndGet();
  if (count > 0) {
    SettingsCache.wipe(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str");
  return count;
}

Fixed version (ground truth):
@Override public int delete(Uri url,String where,String[] whereArgs){
  SqlArguments args=new SqlArguments(url,where,whereArgs);
  if (TABLE_FAVORITES.equals(args.table)) {
    return 0;
  }
 else   if (TABLE_OLD_FAVORITES.equals(args.table)) {
    args.table=TABLE_FAVORITES;
  }
  checkWritePermissions(args);
  sKnownMutationsInFlight.incrementAndGet();
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  int count=db.delete(args.table,args.where,args.args);
  sKnownMutationsInFlight.decrementAndGet();
  if (count > 0) {
    SettingsCache.invalidate(args.table);
    sendNotify(url);
  }
  startAsyncCachePopulation();
  if (LOCAL_LOGV)   Log.v(TAG,args.table + "String_Node_Str" + count+ "String_Node_Str");
  return count;
}
Program: 41391
Project: 41391
Buggy source:
public void dump(Printer pw,String prefix){
  super.dumpFront(pw,prefix);
  if (className != null) {
    pw.println(prefix + "String_Node_Str" + className);
  }
  if (permission != null) {
    pw.println(prefix + "String_Node_Str" + permission);
  }
  pw.println(prefix + "String_Node_Str" + uid+ "String_Node_Str"+ taskAffinity);
  if (theme != 0) {
    pw.println(prefix + "String_Node_Str" + Integer.toHexString(theme));
  }
  pw.println(prefix + "String_Node_Str" + Integer.toHexString(flags)+ "String_Node_Str"+ processName);
  pw.println(prefix + "String_Node_Str" + sourceDir);
  pw.println(prefix + "String_Node_Str" + publicSourceDir);
  pw.println(prefix + "String_Node_Str" + resourceDirs);
  pw.println(prefix + "String_Node_Str" + dataDir);
  if (sharedLibraryFiles != null) {
    pw.println(prefix + "String_Node_Str" + sharedLibraryFiles);
  }
  pw.println(prefix + "String_Node_Str" + enabled+ "String_Node_Str"+ targetSdkVersion);
  if (manageSpaceActivityName != null) {
    pw.println(prefix + "String_Node_Str" + manageSpaceActivityName);
  }
  if (descriptionRes != 0) {
    pw.println(prefix + "String_Node_Str" + Integer.toHexString(descriptionRes));
  }
  super.dumpBack(pw,prefix);
}

Fixed version (ground truth):
public void dump(Printer pw,String prefix){
  super.dumpFront(pw,prefix);
  if (className != null) {
    pw.println(prefix + "String_Node_Str" + className);
  }
  if (permission != null) {
    pw.println(prefix + "String_Node_Str" + permission);
  }
  pw.println(prefix + "String_Node_Str" + processName);
  pw.println(prefix + "String_Node_Str" + taskAffinity);
  pw.println(prefix + "String_Node_Str" + uid+ "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ Integer.toHexString(theme));
  pw.println(prefix + "String_Node_Str" + sourceDir);
  if (!sourceDir.equals(publicSourceDir)) {
    pw.println(prefix + "String_Node_Str" + publicSourceDir);
  }
  if (resourceDirs != null) {
    pw.println(prefix + "String_Node_Str" + resourceDirs);
  }
  pw.println(prefix + "String_Node_Str" + dataDir);
  if (sharedLibraryFiles != null) {
    pw.println(prefix + "String_Node_Str" + sharedLibraryFiles);
  }
  pw.println(prefix + "String_Node_Str" + enabled+ "String_Node_Str"+ targetSdkVersion);
  if (manageSpaceActivityName != null) {
    pw.println(prefix + "String_Node_Str" + manageSpaceActivityName);
  }
  if (descriptionRes != 0) {
    pw.println(prefix + "String_Node_Str" + Integer.toHexString(descriptionRes));
  }
  super.dumpBack(pw,prefix);
}
Program: 41392
Project: 41392
Buggy source:
private final void realStartServiceLocked(ServiceRecord r,ProcessRecord app) throws RemoteException {
  if (app.thread == null) {
    throw new RemoteException();
  }
  r.app=app;
  r.restartTime=r.lastActivity=SystemClock.uptimeMillis();
  app.services.add(r);
  bumpServiceExecutingLocked(r);
  updateLruProcessLocked(app,true,true);
  boolean created=false;
  try {
    if (DEBUG_SERVICE)     Slog.v(TAG,"String_Node_Str" + r.name + "String_Node_Str"+ r.intent);
    mStringBuilder.setLength(0);
    r.intent.getIntent().toShortString(mStringBuilder,false,true);
    EventLog.writeEvent(EventLogTags.AM_CREATE_SERVICE,System.identityHashCode(r),r.shortName,mStringBuilder.toString(),r.app.pid);
synchronized (r.stats.getBatteryStats()) {
      r.stats.startLaunchedLocked();
    }
    ensurePackageDexOpt(r.serviceInfo.packageName);
    app.thread.scheduleCreateService(r,r.serviceInfo);
    r.postNotification();
    created=true;
  }
  finally {
    if (!created) {
      app.services.remove(r);
      scheduleServiceRestartLocked(r,false);
    }
  }
  requestServiceBindingsLocked(r);
  if (r.startRequested && r.callStart && r.pendingStarts.size() == 0) {
    r.lastStartId++;
    if (r.lastStartId < 1) {
      r.lastStartId=1;
    }
    r.pendingStarts.add(new ServiceRecord.StartItem(r.lastStartId,null));
  }
  sendServiceArgsLocked(r,true);
}

Fixed version (ground truth):
private final void realStartServiceLocked(ServiceRecord r,ProcessRecord app) throws RemoteException {
  if (app.thread == null) {
    throw new RemoteException();
  }
  r.app=app;
  r.restartTime=r.lastActivity=SystemClock.uptimeMillis();
  app.services.add(r);
  bumpServiceExecutingLocked(r);
  updateLruProcessLocked(app,true,true);
  boolean created=false;
  try {
    if (DEBUG_SERVICE)     Slog.v(TAG,"String_Node_Str" + r.name + "String_Node_Str"+ r.intent);
    mStringBuilder.setLength(0);
    r.intent.getIntent().toShortString(mStringBuilder,false,true);
    EventLog.writeEvent(EventLogTags.AM_CREATE_SERVICE,System.identityHashCode(r),r.shortName,mStringBuilder.toString(),r.app.pid);
synchronized (r.stats.getBatteryStats()) {
      r.stats.startLaunchedLocked();
    }
    ensurePackageDexOpt(r.serviceInfo.packageName);
    app.thread.scheduleCreateService(r,r.serviceInfo);
    r.postNotification();
    created=true;
  }
  finally {
    if (!created) {
      app.services.remove(r);
      scheduleServiceRestartLocked(r,false);
    }
  }
  requestServiceBindingsLocked(r);
  if (r.startRequested && r.callStart && r.pendingStarts.size() == 0) {
    r.lastStartId++;
    if (r.lastStartId < 1) {
      r.lastStartId=1;
    }
    r.pendingStarts.add(new ServiceRecord.StartItem(r,r.lastStartId,null,-1));
  }
  sendServiceArgsLocked(r,true);
}
Program: 41393
Project: 41393
Buggy source:
void grantUriPermissionFromIntentLocked(int callingUid,String targetPkg,Intent intent,ActivityRecord activity){
  if (DEBUG_URI_PERMISSION)   Slog.v(TAG,"String_Node_Str" + (intent != null ? intent.getData() : null) + "String_Node_Str"+ intent+ "String_Node_Str"+ Integer.toHexString(intent != null ? intent.getFlags() : 0));
  if (intent == null) {
    return;
  }
  Uri data=intent.getData();
  if (data == null) {
    return;
  }
  grantUriPermissionLocked(callingUid,targetPkg,data,intent.getFlags(),activity);
}

Fixed version (ground truth):
void grantUriPermissionFromIntentLocked(int callingUid,String targetPkg,Intent intent,UriPermissionOwner owner){
  int targetUid=checkGrantUriPermissionFromIntentLocked(callingUid,targetPkg,intent);
  if (targetUid < 0) {
    return;
  }
  grantUriPermissionUncheckedFromIntentLocked(targetUid,targetPkg,intent,owner);
}
Program: 41394
Project: 41394
Buggy source:
public boolean stopServiceToken(ComponentName className,IBinder token,int startId){
synchronized (this) {
    if (DEBUG_SERVICE)     Slog.v(TAG,"String_Node_Str" + className + "String_Node_Str"+ token+ "String_Node_Str"+ startId);
    ServiceRecord r=findServiceLocked(className,token);
    if (r != null) {
      if (startId >= 0) {
        ServiceRecord.StartItem si=r.findDeliveredStart(startId,false);
        if (si != null) {
          while (r.deliveredStarts.size() > 0) {
            if (r.deliveredStarts.remove(0) == si) {
              break;
            }
          }
        }
        if (r.lastStartId != startId) {
          return false;
        }
        if (r.deliveredStarts.size() > 0) {
          Slog.w(TAG,"String_Node_Str" + startId + "String_Node_Str"+ r.deliveredStarts.size()+ "String_Node_Str");
        }
      }
synchronized (r.stats.getBatteryStats()) {
        r.stats.stopRunningLocked();
        r.startRequested=false;
        r.callStart=false;
      }
      final long origId=Binder.clearCallingIdentity();
      bringDownServiceLocked(r,false);
      Binder.restoreCallingIdentity(origId);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean stopServiceToken(ComponentName className,IBinder token,int startId){
synchronized (this) {
    if (DEBUG_SERVICE)     Slog.v(TAG,"String_Node_Str" + className + "String_Node_Str"+ token+ "String_Node_Str"+ startId);
    ServiceRecord r=findServiceLocked(className,token);
    if (r != null) {
      if (startId >= 0) {
        ServiceRecord.StartItem si=r.findDeliveredStart(startId,false);
        if (si != null) {
          while (r.deliveredStarts.size() > 0) {
            ServiceRecord.StartItem cur=r.deliveredStarts.remove(0);
            cur.removeUriPermissionsLocked();
            if (cur == si) {
              break;
            }
          }
        }
        if (r.lastStartId != startId) {
          return false;
        }
        if (r.deliveredStarts.size() > 0) {
          Slog.w(TAG,"String_Node_Str" + startId + "String_Node_Str"+ r.deliveredStarts.size()+ "String_Node_Str");
        }
      }
synchronized (r.stats.getBatteryStats()) {
        r.stats.stopRunningLocked();
        r.startRequested=false;
        r.callStart=false;
      }
      final long origId=Binder.clearCallingIdentity();
      bringDownServiceLocked(r,false);
      Binder.restoreCallingIdentity(origId);
      return true;
    }
  }
  return false;
}