nus-yam/ex-repair huggingface dataset:
Program: 21945
Project: 21945
Buggy source:
void noteStopWakeLocked(WakeLock wl,WorkSource ws){
  try {
    if (ws != null) {
      mBatteryStats.noteStopWakelockFromSource(ws,wl.pid,wl.tag,wl.monitorType);
    }
 else {
      mBatteryStats.noteStopWakelock(wl.uid,wl.pid,wl.tag,wl.monitorType);
    }
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
void noteStopWakeLocked(WakeLock wl,WorkSource ws){
  if (wl.monitorType >= 0) {
    long origId=Binder.clearCallingIdentity();
    try {
      if (ws != null) {
        mBatteryStats.noteStopWakelockFromSource(ws,wl.pid,wl.tag,wl.monitorType);
      }
 else {
        mBatteryStats.noteStopWakelock(wl.uid,wl.pid,wl.tag,wl.monitorType);
      }
    }
 catch (    RemoteException e) {
    }
 finally {
      Binder.restoreCallingIdentity(origId);
    }
  }
}
Program: 21946
Project: 21946
Buggy source:
public void updateWakeLockWorkSource(IBinder lock,WorkSource ws){
  int uid=Binder.getCallingUid();
  int pid=Binder.getCallingPid();
  if (ws != null && ws.size() == 0) {
    ws=null;
  }
  if (ws != null) {
    enforceWakeSourcePermission(uid,pid);
  }
  long ident=Binder.clearCallingIdentity();
  try {
synchronized (mLocks) {
      int index=mLocks.getIndex(lock);
      if (index < 0) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      WakeLock wl=mLocks.get(index);
      WorkSource oldsource=wl.ws;
      wl.ws=ws != null ? new WorkSource(ws) : null;
      noteStopWakeLocked(wl,oldsource);
      noteStartWakeLocked(wl,ws);
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}

Fixed version (ground truth):
public void updateWakeLockWorkSource(IBinder lock,WorkSource ws){
  int uid=Binder.getCallingUid();
  int pid=Binder.getCallingPid();
  if (ws != null && ws.size() == 0) {
    ws=null;
  }
  if (ws != null) {
    enforceWakeSourcePermission(uid,pid);
  }
synchronized (mLocks) {
    int index=mLocks.getIndex(lock);
    if (index < 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    WakeLock wl=mLocks.get(index);
    WorkSource oldsource=wl.ws;
    wl.ws=ws != null ? new WorkSource(ws) : null;
    noteStopWakeLocked(wl,oldsource);
    noteStartWakeLocked(wl,ws);
  }
}
Program: 21947
Project: 21947
Buggy source:
void noteStartWakeLocked(WakeLock wl,WorkSource ws){
  try {
    if (ws != null) {
      mBatteryStats.noteStartWakelockFromSource(ws,wl.pid,wl.tag,wl.monitorType);
    }
 else {
      mBatteryStats.noteStartWakelock(wl.uid,wl.pid,wl.tag,wl.monitorType);
    }
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
void noteStartWakeLocked(WakeLock wl,WorkSource ws){
  if (wl.monitorType >= 0) {
    long origId=Binder.clearCallingIdentity();
    try {
      if (ws != null) {
        mBatteryStats.noteStartWakelockFromSource(ws,wl.pid,wl.tag,wl.monitorType);
      }
 else {
        mBatteryStats.noteStartWakelock(wl.uid,wl.pid,wl.tag,wl.monitorType);
      }
    }
 catch (    RemoteException e) {
    }
 finally {
      Binder.restoreCallingIdentity(origId);
    }
  }
}
Program: 21948
Project: 21948
Buggy source:
private void releaseWakeLockLocked(IBinder lock,int flags,boolean death){
  WakeLock wl=mLocks.removeLock(lock);
  if (wl == null) {
    return;
  }
  if (mSpew) {
    Slog.d(TAG,"String_Node_Str" + Integer.toHexString(wl.flags) + "String_Node_Str"+ wl.tag);
  }
  if (isScreenLock(wl.flags)) {
    mWakeLockState=mLocks.gatherState();
    if ((wl.flags & PowerManager.ON_AFTER_RELEASE) != 0) {
      userActivity(SystemClock.uptimeMillis(),false);
    }
    setPowerState(mWakeLockState | mUserState);
  }
 else   if ((wl.flags & LOCK_MASK) == PowerManager.PARTIAL_WAKE_LOCK) {
    mPartialCount--;
    if (mPartialCount == 0) {
      if (LOG_PARTIAL_WL)       EventLog.writeEvent(EventLogTags.POWER_PARTIAL_WAKE_STATE,0,wl.tag);
      Power.releaseWakeLock(PARTIAL_NAME);
    }
  }
 else   if ((wl.flags & LOCK_MASK) == PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK) {
    mProximityWakeLockCount--;
    if (mProximityWakeLockCount == 0) {
      if (mProximitySensorActive && ((flags & PowerManager.WAIT_FOR_PROXIMITY_NEGATIVE) != 0)) {
        if (mDebugProximitySensor) {
          Slog.d(TAG,"String_Node_Str");
        }
      }
 else {
        disableProximityLockLocked();
      }
    }
  }
  wl.binder.unlinkToDeath(wl,0);
  if (wl.monitorType >= 0) {
    long origId=Binder.clearCallingIdentity();
    try {
      noteStopWakeLocked(wl,wl.ws);
    }
  finally {
      Binder.restoreCallingIdentity(origId);
    }
  }
}

Fixed version (ground truth):
private void releaseWakeLockLocked(IBinder lock,int flags,boolean death){
  WakeLock wl=mLocks.removeLock(lock);
  if (wl == null) {
    return;
  }
  if (mSpew) {
    Slog.d(TAG,"String_Node_Str" + Integer.toHexString(wl.flags) + "String_Node_Str"+ wl.tag);
  }
  if (isScreenLock(wl.flags)) {
    mWakeLockState=mLocks.gatherState();
    if ((wl.flags & PowerManager.ON_AFTER_RELEASE) != 0) {
      userActivity(SystemClock.uptimeMillis(),false);
    }
    setPowerState(mWakeLockState | mUserState);
  }
 else   if ((wl.flags & LOCK_MASK) == PowerManager.PARTIAL_WAKE_LOCK) {
    mPartialCount--;
    if (mPartialCount == 0) {
      if (LOG_PARTIAL_WL)       EventLog.writeEvent(EventLogTags.POWER_PARTIAL_WAKE_STATE,0,wl.tag);
      Power.releaseWakeLock(PARTIAL_NAME);
    }
  }
 else   if ((wl.flags & LOCK_MASK) == PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK) {
    mProximityWakeLockCount--;
    if (mProximityWakeLockCount == 0) {
      if (mProximitySensorActive && ((flags & PowerManager.WAIT_FOR_PROXIMITY_NEGATIVE) != 0)) {
        if (mDebugProximitySensor) {
          Slog.d(TAG,"String_Node_Str");
        }
      }
 else {
        disableProximityLockLocked();
      }
    }
  }
  wl.binder.unlinkToDeath(wl,0);
  noteStopWakeLocked(wl,wl.ws);
}
Program: 21949
Project: 21949
Buggy source:
void clearModes(int modeFlags){
  if ((modeFlags & Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) {
    globalModeFlags&=~Intent.FLAG_GRANT_READ_URI_PERMISSION;
    modeFlags&=~Intent.FLAG_GRANT_READ_URI_PERMISSION;
    if (readOwners.size() > 0) {
      for (      UriPermissionOwner r : readOwners) {
        r.removeReadPermission(this);
      }
      readOwners.clear();
    }
  }
  if ((modeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) {
    globalModeFlags&=~Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
    modeFlags&=~Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
    if (readOwners.size() > 0) {
      for (      UriPermissionOwner r : writeOwners) {
        r.removeWritePermission(this);
      }
      readOwners.clear();
    }
  }
}

Fixed version (ground truth):
void clearModes(int modeFlagsToClear){
  if ((modeFlagsToClear & Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) {
    globalModeFlags&=~Intent.FLAG_GRANT_READ_URI_PERMISSION;
    modeFlags&=~Intent.FLAG_GRANT_READ_URI_PERMISSION;
    if (readOwners.size() > 0) {
      for (      UriPermissionOwner r : readOwners) {
        r.removeReadPermission(this);
      }
      readOwners.clear();
    }
  }
  if ((modeFlagsToClear & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) {
    globalModeFlags&=~Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
    modeFlags&=~Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
    if (readOwners.size() > 0) {
      for (      UriPermissionOwner r : writeOwners) {
        r.removeWritePermission(this);
      }
      readOwners.clear();
    }
  }
}
Program: 21950
Project: 21950
Buggy source:
public boolean remove(WorkSource other){
  int N1=mNum;
  final int[] uids1=mUids;
  final int N2=other.mNum;
  final int[] uids2=other.mUids;
  boolean changed=false;
  int i1=0;
  for (int i2=0; i2 < N2 && i1 < N1; i2++) {
    if (uids2[i2] == uids1[i1]) {
      N1--;
      if (i1 < N1)       System.arraycopy(uids1,i1,uids1,i1 - 1,N1 - i1);
    }
    while (i1 < N1 && uids2[i2] > uids1[i1]) {
      i1++;
    }
  }
  mNum=N1;
  return changed;
}

Fixed version (ground truth):
public boolean remove(WorkSource other){
  int N1=mNum;
  final int[] uids1=mUids;
  final int N2=other.mNum;
  final int[] uids2=other.mUids;
  boolean changed=false;
  int i1=0;
  for (int i2=0; i2 < N2 && i1 < N1; i2++) {
    if (uids2[i2] == uids1[i1]) {
      N1--;
      if (i1 < N1)       System.arraycopy(uids1,i1 + 1,uids1,i1,N1 - i1);
    }
    while (i1 < N1 && uids2[i2] > uids1[i1]) {
      i1++;
    }
  }
  mNum=N1;
  return changed;
}
Program: 21951
Project: 21951
Buggy source:
private boolean handleAuthentication(ResponseEvent event) throws SipException {
  Response response=event.getResponse();
  String nonce=getNonceFromResponse(response);
  if (((nonce != null) && nonce.equals(mLastNonce)) || (nonce == mLastNonce)) {
    return false;
  }
 else {
    mClientTransaction=mSipHelper.handleChallenge(event,getAccountManager());
    mDialog=mClientTransaction.getDialog();
    mLastNonce=nonce;
    return true;
  }
}

Fixed version (ground truth):
private boolean handleAuthentication(ResponseEvent event) throws SipException {
  Response response=event.getResponse();
  String nonce=getNonceFromResponse(response);
  if (((nonce != null) && nonce.equals(mLastNonce)) || (nonce == null)) {
    mLastNonce=nonce;
    return false;
  }
 else {
    mClientTransaction=mSipHelper.handleChallenge(event,getAccountManager());
    mDialog=mClientTransaction.getDialog();
    mLastNonce=nonce;
    return true;
  }
}
Program: 21952
Project: 21952
Buggy source:
private String getNonceFromResponse(Response response){
  WWWAuthenticate authHeader=(WWWAuthenticate)(response.getHeader(SIPHeaderNames.WWW_AUTHENTICATE));
  return (authHeader == null) ? null : authHeader.getNonce();
}

Fixed version (ground truth):
private String getNonceFromResponse(Response response){
  WWWAuthenticate wwwAuth=(WWWAuthenticate)response.getHeader(SIPHeaderNames.WWW_AUTHENTICATE);
  if (wwwAuth != null)   return wwwAuth.getNonce();
  ProxyAuthenticate proxyAuth=(ProxyAuthenticate)response.getHeader(SIPHeaderNames.PROXY_AUTHENTICATE);
  return (proxyAuth == null) ? null : proxyAuth.getNonce();
}
Program: 21953
Project: 21953
Buggy source:
private boolean handleAuthentication(ResponseEvent event) throws SipException {
  Response response=event.getResponse();
  String nonce=getNonceFromResponse(response);
  if (((nonce != null) && nonce.equals(mLastNonce)) || (nonce == mLastNonce)) {
    return false;
  }
 else {
    mClientTransaction=mSipHelper.handleChallenge(event,getAccountManager());
    mDialog=mClientTransaction.getDialog();
    mLastNonce=nonce;
    return true;
  }
}

Fixed version (ground truth):
private boolean handleAuthentication(ResponseEvent event) throws SipException {
  Response response=event.getResponse();
  String nonce=getNonceFromResponse(response);
  if (((nonce != null) && nonce.equals(mLastNonce)) || (nonce == null)) {
    mLastNonce=nonce;
    return false;
  }
 else {
    mClientTransaction=mSipHelper.handleChallenge(event,getAccountManager());
    mDialog=mClientTransaction.getDialog();
    mLastNonce=nonce;
    return true;
  }
}
Program: 21954
Project: 21954
Buggy source:
private String getNonceFromResponse(Response response){
  WWWAuthenticate authHeader=(WWWAuthenticate)(response.getHeader(SIPHeaderNames.WWW_AUTHENTICATE));
  return (authHeader == null) ? null : authHeader.getNonce();
}

Fixed version (ground truth):
private String getNonceFromResponse(Response response){
  WWWAuthenticate wwwAuth=(WWWAuthenticate)response.getHeader(SIPHeaderNames.WWW_AUTHENTICATE);
  if (wwwAuth != null)   return wwwAuth.getNonce();
  ProxyAuthenticate proxyAuth=(ProxyAuthenticate)response.getHeader(SIPHeaderNames.PROXY_AUTHENTICATE);
  return (proxyAuth == null) ? null : proxyAuth.getNonce();
}
Program: 21955
Project: 21955
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: 21956
Project: 21956
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: 21958
Project: 21958
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: 21960
Project: 21960
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: 21961
Project: 21961
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: 21964
Project: 21964
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: 21966
Project: 21966
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: 21967
Project: 21967
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: 21970
Project: 21970
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: 21972
Project: 21972
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: 21973
Project: 21973
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: 21974
Project: 21974
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: 21975
Project: 21975
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: 21976
Project: 21976
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: 21977
Project: 21977
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: 21978
Project: 21978
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: 21979
Project: 21979
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: 21980
Project: 21980
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: 21981
Project: 21981
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: 21982
Project: 21982
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: 21983
Project: 21983
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: 21984
Project: 21984
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: 21985
Project: 21985
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: 21986
Project: 21986
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: 21991
Project: 21991
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);
}