nus-yam/ex-repair huggingface dataset:
Program: 41948
Project: 41948
Buggy source:
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      if (mFocusStack.peek().mFocusChangeType == focusChangeHint) {
        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
      }
      mFocusStack.pop();
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      if (mFocusStack.peek().mFocusChangeType == focusChangeHint) {
        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
      }
      mFocusStack.pop();
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    removeFocusStackEntry(clientId,false);
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 41949
Project: 41949
Buggy source:
/** 
 * Request audio focus. Send a request to obtain the audio focus for a specific stream type
 * @param l the listener to be notified of audio focus changes
 * @param streamType the main audio stream type affected by the focus request
 * @param durationHint use {@link #AUDIOFOCUS_GAIN_TRANSIENT} to indicate this focus requestis temporary, and focus will be abandonned shortly. Examples of transient requests are for the playback of driving directions, or notifications sounds. Use  {@link #AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK} to indicate also that it's ok forthe previous focus owner to keep playing if it ducks its audio output. Use  {@link #AUDIOFOCUS_GAIN} for a focus request of unknown duration suchas the playback of a song or a video.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int requestAudioFocus(OnAudioFocusChangeListener l,int streamType,int durationHint){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.requestAudioFocus(streamType,durationHint,mICallBack,mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}

Fixed version (ground truth):
/** 
 * Request audio focus. Send a request to obtain the audio focus for a specific stream type
 * @param l the listener to be notified of audio focus changes
 * @param streamType the main audio stream type affected by the focus request
 * @param durationHint use {@link #AUDIOFOCUS_GAIN_TRANSIENT} to indicate this focus requestis temporary, and focus will be abandonned shortly. Examples of transient requests are for the playback of driving directions, or notifications sounds. Use  {@link #AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK} to indicate also that it's ok forthe previous focus owner to keep playing if it ducks its audio output. Use  {@link #AUDIOFOCUS_GAIN} for a focus request of unknown duration suchas the playback of a song or a video.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int requestAudioFocus(OnAudioFocusChangeListener l,int streamType,int durationHint){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  if ((durationHint < AUDIOFOCUS_GAIN) || (durationHint > AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK)) {
    Log.e(TAG,"String_Node_Str");
    return status;
  }
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.requestAudioFocus(streamType,durationHint,mICallBack,mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}
Program: 41950
Project: 41950
Buggy source:
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      if (mFocusStack.peek().mFocusChangeType == focusChangeHint) {
        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
      }
      mFocusStack.pop();
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      if (mFocusStack.peek().mFocusChangeType == focusChangeHint) {
        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
      }
      mFocusStack.pop();
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    removeFocusStackEntry(clientId,false);
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 41951
Project: 41951
Buggy source:
/** 
 * Request audio focus. Send a request to obtain the audio focus for a specific stream type
 * @param l the listener to be notified of audio focus changes
 * @param streamType the main audio stream type affected by the focus request
 * @param durationHint use {@link #AUDIOFOCUS_GAIN_TRANSIENT} to indicate this focus requestis temporary, and focus will be abandonned shortly. Examples of transient requests are for the playback of driving directions, or notifications sounds. Use  {@link #AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK} to indicate also that it's ok forthe previous focus owner to keep playing if it ducks its audio output. Use  {@link #AUDIOFOCUS_GAIN} for a focus request of unknown duration suchas the playback of a song or a video.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int requestAudioFocus(OnAudioFocusChangeListener l,int streamType,int durationHint){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.requestAudioFocus(streamType,durationHint,mICallBack,mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}

Fixed version (ground truth):
/** 
 * Request audio focus. Send a request to obtain the audio focus for a specific stream type
 * @param l the listener to be notified of audio focus changes
 * @param streamType the main audio stream type affected by the focus request
 * @param durationHint use {@link #AUDIOFOCUS_GAIN_TRANSIENT} to indicate this focus requestis temporary, and focus will be abandonned shortly. Examples of transient requests are for the playback of driving directions, or notifications sounds. Use  {@link #AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK} to indicate also that it's ok forthe previous focus owner to keep playing if it ducks its audio output. Use  {@link #AUDIOFOCUS_GAIN} for a focus request of unknown duration suchas the playback of a song or a video.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int requestAudioFocus(OnAudioFocusChangeListener l,int streamType,int durationHint){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  if ((durationHint < AUDIOFOCUS_GAIN) || (durationHint > AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK)) {
    Log.e(TAG,"String_Node_Str");
    return status;
  }
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.requestAudioFocus(streamType,durationHint,mICallBack,mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}
Program: 41952
Project: 41952
Buggy source:
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      if (mFocusStack.peek().mFocusChangeType == focusChangeHint) {
        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
      }
      mFocusStack.pop();
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      if (mFocusStack.peek().mFocusChangeType == focusChangeHint) {
        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
      }
      mFocusStack.pop();
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    removeFocusStackEntry(clientId,false);
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 41953
Project: 41953
Buggy source:
/** 
 * Request audio focus. Send a request to obtain the audio focus for a specific stream type
 * @param l the listener to be notified of audio focus changes
 * @param streamType the main audio stream type affected by the focus request
 * @param durationHint use {@link #AUDIOFOCUS_GAIN_TRANSIENT} to indicate this focus requestis temporary, and focus will be abandonned shortly. Examples of transient requests are for the playback of driving directions, or notifications sounds. Use  {@link #AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK} to indicate also that it's ok forthe previous focus owner to keep playing if it ducks its audio output. Use  {@link #AUDIOFOCUS_GAIN} for a focus request of unknown duration suchas the playback of a song or a video.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int requestAudioFocus(OnAudioFocusChangeListener l,int streamType,int durationHint){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.requestAudioFocus(streamType,durationHint,mICallBack,mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}

Fixed version (ground truth):
/** 
 * Request audio focus. Send a request to obtain the audio focus for a specific stream type
 * @param l the listener to be notified of audio focus changes
 * @param streamType the main audio stream type affected by the focus request
 * @param durationHint use {@link #AUDIOFOCUS_GAIN_TRANSIENT} to indicate this focus requestis temporary, and focus will be abandonned shortly. Examples of transient requests are for the playback of driving directions, or notifications sounds. Use  {@link #AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK} to indicate also that it's ok forthe previous focus owner to keep playing if it ducks its audio output. Use  {@link #AUDIOFOCUS_GAIN} for a focus request of unknown duration suchas the playback of a song or a video.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int requestAudioFocus(OnAudioFocusChangeListener l,int streamType,int durationHint){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  if ((durationHint < AUDIOFOCUS_GAIN) || (durationHint > AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK)) {
    Log.e(TAG,"String_Node_Str");
    return status;
  }
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.requestAudioFocus(streamType,durationHint,mICallBack,mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}
Program: 41954
Project: 41954
Buggy source:
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      if (mFocusStack.peek().mFocusChangeType == focusChangeHint) {
        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
      }
      mFocusStack.pop();
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#requestAudioFocus(IAudioFocusDispatcher,int,int) 
 */
public int requestAudioFocus(int mainStreamType,int focusChangeHint,IBinder cb,IAudioFocusDispatcher fd,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  if ((cb == null) || !cb.pingBinder()) {
    Log.i(TAG,"String_Node_Str");
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
  if (!canReassignAudioFocus()) {
    return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
  }
synchronized (mFocusStack) {
    if (!mFocusStack.empty() && mFocusStack.peek().mClientId.equals(clientId)) {
      if (mFocusStack.peek().mFocusChangeType == focusChangeHint) {
        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
      }
      mFocusStack.pop();
    }
    if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) {
      try {
        mFocusStack.peek().mFocusDispatcher.dispatchAudioFocusChange(-1 * focusChangeHint,mFocusStack.peek().mClientId);
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + e);
        e.printStackTrace();
      }
    }
    removeFocusStackEntry(clientId,false);
    mFocusStack.push(new FocusStackEntry(mainStreamType,focusChangeHint,false,fd,cb,clientId));
  }
  AudioFocusDeathHandler afdh=new AudioFocusDeathHandler(cb);
  try {
    cb.linkToDeath(afdh,0);
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str" + cb + "String_Node_Str");
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 41955
Project: 41955
Buggy source:
public void resized(int w,int h,Rect coveredInsets,Rect visibleInsets,boolean reportDraw,Configuration newConfig){
  SurfaceView surfaceView=mSurfaceView.get();
  if (surfaceView != null) {
    if (localLOGV)     Log.v("String_Node_Str",surfaceView + "String_Node_Str" + w+ "String_Node_Str"+ h+ "String_Node_Str"+ mCurWidth+ "String_Node_Str"+ mCurHeight);
synchronized (this) {
      if (mCurWidth != w || mCurHeight != h) {
        mCurWidth=w;
        mCurHeight=h;
      }
      if (reportDraw) {
        try {
          surfaceView.mSession.finishDrawing(surfaceView.mWindow);
        }
 catch (        RemoteException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public void resized(int w,int h,Rect coveredInsets,Rect visibleInsets,boolean reportDraw,Configuration newConfig){
  SurfaceView surfaceView=mSurfaceView.get();
  if (surfaceView != null) {
    if (localLOGV)     Log.v("String_Node_Str",surfaceView + "String_Node_Str" + w+ "String_Node_Str"+ h+ "String_Node_Str"+ mCurWidth+ "String_Node_Str"+ mCurHeight);
    surfaceView.mSurfaceLock.lock();
    try {
      if (reportDraw) {
        surfaceView.mUpdateWindowNeeded=true;
        surfaceView.mReportDrawNeeded=true;
        surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
      }
 else       if (surfaceView.mWinFrame.width() != w || surfaceView.mWinFrame.height() != h) {
        surfaceView.mUpdateWindowNeeded=true;
        surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
      }
    }
  finally {
      surfaceView.mSurfaceLock.unlock();
    }
  }
}
Program: 41956
Project: 41956
Buggy source:
@Override public void handleMessage(Message msg){
switch (msg.what) {
case KEEP_SCREEN_ON_MSG:
{
      setKeepScreenOn(msg.arg1 != 0);
    }
  break;
case GET_NEW_SURFACE_MSG:
{
  handleGetNewSurface();
}
break;
}
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
switch (msg.what) {
case KEEP_SCREEN_ON_MSG:
{
      setKeepScreenOn(msg.arg1 != 0);
    }
  break;
case GET_NEW_SURFACE_MSG:
{
  handleGetNewSurface();
}
break;
case UPDATE_WINDOW_MSG:
{
updateWindow(false);
}
break;
}
}
Program: 41959
Project: 41959
Buggy source:
public void resized(int w,int h,Rect coveredInsets,Rect visibleInsets,boolean reportDraw,Configuration newConfig){
  SurfaceView surfaceView=mSurfaceView.get();
  if (surfaceView != null) {
    if (localLOGV)     Log.v("String_Node_Str",surfaceView + "String_Node_Str" + w+ "String_Node_Str"+ h+ "String_Node_Str"+ mCurWidth+ "String_Node_Str"+ mCurHeight);
synchronized (this) {
      if (mCurWidth != w || mCurHeight != h) {
        mCurWidth=w;
        mCurHeight=h;
      }
      if (reportDraw) {
        try {
          surfaceView.mSession.finishDrawing(surfaceView.mWindow);
        }
 catch (        RemoteException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public void resized(int w,int h,Rect coveredInsets,Rect visibleInsets,boolean reportDraw,Configuration newConfig){
  SurfaceView surfaceView=mSurfaceView.get();
  if (surfaceView != null) {
    if (localLOGV)     Log.v("String_Node_Str",surfaceView + "String_Node_Str" + w+ "String_Node_Str"+ h+ "String_Node_Str"+ mCurWidth+ "String_Node_Str"+ mCurHeight);
    surfaceView.mSurfaceLock.lock();
    try {
      if (reportDraw) {
        surfaceView.mUpdateWindowNeeded=true;
        surfaceView.mReportDrawNeeded=true;
        surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
      }
 else       if (surfaceView.mWinFrame.width() != w || surfaceView.mWinFrame.height() != h) {
        surfaceView.mUpdateWindowNeeded=true;
        surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
      }
    }
  finally {
      surfaceView.mSurfaceLock.unlock();
    }
  }
}
Program: 41960
Project: 41960
Buggy source:
@Override public void handleMessage(Message msg){
switch (msg.what) {
case KEEP_SCREEN_ON_MSG:
{
      setKeepScreenOn(msg.arg1 != 0);
    }
  break;
case GET_NEW_SURFACE_MSG:
{
  handleGetNewSurface();
}
break;
}
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
switch (msg.what) {
case KEEP_SCREEN_ON_MSG:
{
      setKeepScreenOn(msg.arg1 != 0);
    }
  break;
case GET_NEW_SURFACE_MSG:
{
  handleGetNewSurface();
}
break;
case UPDATE_WINDOW_MSG:
{
updateWindow(false);
}
break;
}
}
Program: 41963
Project: 41963
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    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 (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41964
Project: 41964
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    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 (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41966
Project: 41966
Buggy source:
/** 
 * Show the dim surface.
 */
void show(int dw,int dh){
  if (!mDimShown) {
    if (SHOW_TRANSACTIONS)     Slog.i(TAG,"String_Node_Str" + mDimSurface + "String_Node_Str"+ dw+ "String_Node_Str"+ dh+ "String_Node_Str");
    mDimShown=true;
    try {
      mDimSurface.setPosition(0,0);
      mDimSurface.setSize(dw,dh);
      mDimSurface.show();
    }
 catch (    RuntimeException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Show the dim surface.
 */
void show(int dw,int dh){
  if (!mDimShown) {
    if (SHOW_TRANSACTIONS)     Slog.i(TAG,"String_Node_Str" + mDimSurface + "String_Node_Str"+ dw+ "String_Node_Str"+ dh+ "String_Node_Str");
    mDimShown=true;
    try {
      mLastDimWidth=dw;
      mLastDimHeight=dh;
      mDimSurface.setPosition(0,0);
      mDimSurface.setSize(dw,dh);
      mDimSurface.show();
    }
 catch (    RuntimeException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
 else   if (mLastDimWidth != dw || mLastDimHeight != dh) {
    mLastDimWidth=dw;
    mLastDimHeight=dh;
    mDimSurface.setSize(dw,dh);
  }
}
Program: 41968
Project: 41968
Buggy source:
private final int indexOfTokenLocked(IBinder token){
  int count=mHistory.size();
  HistoryRecord r=null;
  int index=-1;
  for (int i=count - 1; i >= 0; i--) {
    Object o=mHistory.get(i);
    if (o == token) {
      r=(HistoryRecord)o;
      index=i;
      break;
    }
  }
  return index;
}

Fixed version (ground truth):
private final int indexOfTokenLocked(IBinder token){
  int count=mHistory.size();
  int index=-1;
  for (int i=count - 1; i >= 0; i--) {
    Object o=mHistory.get(i);
    if (o == token) {
      index=i;
      break;
    }
  }
  return index;
}
Program: 41971
Project: 41971
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    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 (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41972
Project: 41972
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    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 (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41973
Project: 41973
Buggy source:
/** 
 * Show the dim surface.
 */
void show(int dw,int dh){
  if (!mDimShown) {
    if (SHOW_TRANSACTIONS)     Slog.i(TAG,"String_Node_Str" + mDimSurface + "String_Node_Str"+ dw+ "String_Node_Str"+ dh+ "String_Node_Str");
    mDimShown=true;
    try {
      mDimSurface.setPosition(0,0);
      mDimSurface.setSize(dw,dh);
      mDimSurface.show();
    }
 catch (    RuntimeException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Show the dim surface.
 */
void show(int dw,int dh){
  if (!mDimShown) {
    if (SHOW_TRANSACTIONS)     Slog.i(TAG,"String_Node_Str" + mDimSurface + "String_Node_Str"+ dw+ "String_Node_Str"+ dh+ "String_Node_Str");
    mDimShown=true;
    try {
      mLastDimWidth=dw;
      mLastDimHeight=dh;
      mDimSurface.setPosition(0,0);
      mDimSurface.setSize(dw,dh);
      mDimSurface.show();
    }
 catch (    RuntimeException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
 else   if (mLastDimWidth != dw || mLastDimHeight != dh) {
    mLastDimWidth=dw;
    mLastDimHeight=dh;
    mDimSurface.setSize(dw,dh);
  }
}
Program: 41975
Project: 41975
Buggy source:
private final int indexOfTokenLocked(IBinder token){
  int count=mHistory.size();
  HistoryRecord r=null;
  int index=-1;
  for (int i=count - 1; i >= 0; i--) {
    Object o=mHistory.get(i);
    if (o == token) {
      r=(HistoryRecord)o;
      index=i;
      break;
    }
  }
  return index;
}

Fixed version (ground truth):
private final int indexOfTokenLocked(IBinder token){
  int count=mHistory.size();
  int index=-1;
  for (int i=count - 1; i >= 0; i--) {
    Object o=mHistory.get(i);
    if (o == token) {
      index=i;
      break;
    }
  }
  return index;
}
Program: 41977
Project: 41977
Buggy source:
/** 
 * Show the dim surface.
 */
void show(int dw,int dh){
  if (!mDimShown) {
    if (SHOW_TRANSACTIONS)     Slog.i(TAG,"String_Node_Str" + mDimSurface + "String_Node_Str"+ dw+ "String_Node_Str"+ dh+ "String_Node_Str");
    mDimShown=true;
    try {
      mDimSurface.setPosition(0,0);
      mDimSurface.setSize(dw,dh);
      mDimSurface.show();
    }
 catch (    RuntimeException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Show the dim surface.
 */
void show(int dw,int dh){
  if (!mDimShown) {
    if (SHOW_TRANSACTIONS)     Slog.i(TAG,"String_Node_Str" + mDimSurface + "String_Node_Str"+ dw+ "String_Node_Str"+ dh+ "String_Node_Str");
    mDimShown=true;
    try {
      mLastDimWidth=dw;
      mLastDimHeight=dh;
      mDimSurface.setPosition(0,0);
      mDimSurface.setSize(dw,dh);
      mDimSurface.show();
    }
 catch (    RuntimeException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
 else   if (mLastDimWidth != dw || mLastDimHeight != dh) {
    mLastDimWidth=dw;
    mLastDimHeight=dh;
    mDimSurface.setSize(dw,dh);
  }
}
Program: 41979
Project: 41979
Buggy source:
private final int indexOfTokenLocked(IBinder token){
  int count=mHistory.size();
  HistoryRecord r=null;
  int index=-1;
  for (int i=count - 1; i >= 0; i--) {
    Object o=mHistory.get(i);
    if (o == token) {
      r=(HistoryRecord)o;
      index=i;
      break;
    }
  }
  return index;
}

Fixed version (ground truth):
private final int indexOfTokenLocked(IBinder token){
  int count=mHistory.size();
  int index=-1;
  for (int i=count - 1; i >= 0; i--) {
    Object o=mHistory.get(i);
    if (o == token) {
      index=i;
      break;
    }
  }
  return index;
}
Program: 41981
Project: 41981
Buggy source:
/** 
 * Show the dim surface.
 */
void show(int dw,int dh){
  if (!mDimShown) {
    if (SHOW_TRANSACTIONS)     Slog.i(TAG,"String_Node_Str" + mDimSurface + "String_Node_Str"+ dw+ "String_Node_Str"+ dh+ "String_Node_Str");
    mDimShown=true;
    try {
      mDimSurface.setPosition(0,0);
      mDimSurface.setSize(dw,dh);
      mDimSurface.show();
    }
 catch (    RuntimeException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Show the dim surface.
 */
void show(int dw,int dh){
  if (!mDimShown) {
    if (SHOW_TRANSACTIONS)     Slog.i(TAG,"String_Node_Str" + mDimSurface + "String_Node_Str"+ dw+ "String_Node_Str"+ dh+ "String_Node_Str");
    mDimShown=true;
    try {
      mLastDimWidth=dw;
      mLastDimHeight=dh;
      mDimSurface.setPosition(0,0);
      mDimSurface.setSize(dw,dh);
      mDimSurface.show();
    }
 catch (    RuntimeException e) {
      Slog.w(TAG,"String_Node_Str",e);
    }
  }
 else   if (mLastDimWidth != dw || mLastDimHeight != dh) {
    mLastDimWidth=dw;
    mLastDimHeight=dh;
    mDimSurface.setSize(dw,dh);
  }
}
Program: 41983
Project: 41983
Buggy source:
private final int indexOfTokenLocked(IBinder token){
  int count=mHistory.size();
  HistoryRecord r=null;
  int index=-1;
  for (int i=count - 1; i >= 0; i--) {
    Object o=mHistory.get(i);
    if (o == token) {
      r=(HistoryRecord)o;
      index=i;
      break;
    }
  }
  return index;
}

Fixed version (ground truth):
private final int indexOfTokenLocked(IBinder token){
  int count=mHistory.size();
  int index=-1;
  for (int i=count - 1; i >= 0; i--) {
    Object o=mHistory.get(i);
    if (o == token) {
      index=i;
      break;
    }
  }
  return index;
}
Program: 41985
Project: 41985
Buggy source:
public void resized(int w,int h,Rect coveredInsets,Rect visibleInsets,boolean reportDraw,Configuration newConfig){
  SurfaceView surfaceView=mSurfaceView.get();
  if (surfaceView != null) {
    if (localLOGV)     Log.v("String_Node_Str",surfaceView + "String_Node_Str" + w+ "String_Node_Str"+ h+ "String_Node_Str"+ mCurWidth+ "String_Node_Str"+ mCurHeight);
synchronized (this) {
      if (mCurWidth != w || mCurHeight != h) {
        mCurWidth=w;
        mCurHeight=h;
      }
      if (reportDraw) {
        try {
          surfaceView.mSession.finishDrawing(surfaceView.mWindow);
        }
 catch (        RemoteException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public void resized(int w,int h,Rect coveredInsets,Rect visibleInsets,boolean reportDraw,Configuration newConfig){
  SurfaceView surfaceView=mSurfaceView.get();
  if (surfaceView != null) {
    if (localLOGV)     Log.v("String_Node_Str",surfaceView + "String_Node_Str" + w+ "String_Node_Str"+ h+ "String_Node_Str"+ mCurWidth+ "String_Node_Str"+ mCurHeight);
    surfaceView.mSurfaceLock.lock();
    try {
      if (reportDraw) {
        surfaceView.mUpdateWindowNeeded=true;
        surfaceView.mReportDrawNeeded=true;
        surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
      }
 else       if (surfaceView.mWinFrame.width() != w || surfaceView.mWinFrame.height() != h) {
        surfaceView.mUpdateWindowNeeded=true;
        surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
      }
    }
  finally {
      surfaceView.mSurfaceLock.unlock();
    }
  }
}
Program: 41986
Project: 41986
Buggy source:
@Override public void handleMessage(Message msg){
switch (msg.what) {
case KEEP_SCREEN_ON_MSG:
{
      setKeepScreenOn(msg.arg1 != 0);
    }
  break;
case GET_NEW_SURFACE_MSG:
{
  handleGetNewSurface();
}
break;
}
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
switch (msg.what) {
case KEEP_SCREEN_ON_MSG:
{
      setKeepScreenOn(msg.arg1 != 0);
    }
  break;
case GET_NEW_SURFACE_MSG:
{
  handleGetNewSurface();
}
break;
case UPDATE_WINDOW_MSG:
{
updateWindow(false);
}
break;
}
}
Program: 41988
Project: 41988
Buggy source:
public void resized(int w,int h,Rect coveredInsets,Rect visibleInsets,boolean reportDraw,Configuration newConfig){
  SurfaceView surfaceView=mSurfaceView.get();
  if (surfaceView != null) {
    if (localLOGV)     Log.v("String_Node_Str",surfaceView + "String_Node_Str" + w+ "String_Node_Str"+ h+ "String_Node_Str"+ mCurWidth+ "String_Node_Str"+ mCurHeight);
synchronized (this) {
      if (mCurWidth != w || mCurHeight != h) {
        mCurWidth=w;
        mCurHeight=h;
      }
      if (reportDraw) {
        try {
          surfaceView.mSession.finishDrawing(surfaceView.mWindow);
        }
 catch (        RemoteException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public void resized(int w,int h,Rect coveredInsets,Rect visibleInsets,boolean reportDraw,Configuration newConfig){
  SurfaceView surfaceView=mSurfaceView.get();
  if (surfaceView != null) {
    if (localLOGV)     Log.v("String_Node_Str",surfaceView + "String_Node_Str" + w+ "String_Node_Str"+ h+ "String_Node_Str"+ mCurWidth+ "String_Node_Str"+ mCurHeight);
    surfaceView.mSurfaceLock.lock();
    try {
      if (reportDraw) {
        surfaceView.mUpdateWindowNeeded=true;
        surfaceView.mReportDrawNeeded=true;
        surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
      }
 else       if (surfaceView.mWinFrame.width() != w || surfaceView.mWinFrame.height() != h) {
        surfaceView.mUpdateWindowNeeded=true;
        surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
      }
    }
  finally {
      surfaceView.mSurfaceLock.unlock();
    }
  }
}
Program: 41989
Project: 41989
Buggy source:
@Override public void handleMessage(Message msg){
switch (msg.what) {
case KEEP_SCREEN_ON_MSG:
{
      setKeepScreenOn(msg.arg1 != 0);
    }
  break;
case GET_NEW_SURFACE_MSG:
{
  handleGetNewSurface();
}
break;
}
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
switch (msg.what) {
case KEEP_SCREEN_ON_MSG:
{
      setKeepScreenOn(msg.arg1 != 0);
    }
  break;
case GET_NEW_SURFACE_MSG:
{
  handleGetNewSurface();
}
break;
case UPDATE_WINDOW_MSG:
{
updateWindow(false);
}
break;
}
}
Program: 41991
Project: 41991
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    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 (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41992
Project: 41992
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    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 (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41993
Project: 41993
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    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 (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41994
Project: 41994
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    int oldX=mScrollX;
    int oldY=mScrollY;
    int x=mScroller.getCurrX();
    int y=mScroller.getCurrY();
    if (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    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 (getChildCount() > 0) {
      View child=getChildAt(0);
      x=clamp(x,getWidth() - mPaddingRight - mPaddingLeft,child.getWidth());
      y=clamp(y,getHeight() - mPaddingBottom - mPaddingTop,child.getHeight());
      if (x != oldX || y != oldY) {
        mScrollX=x;
        mScrollY=y;
        onScrollChanged(x,y,oldX,oldY);
      }
    }
    awakenScrollBars();
    postInvalidate();
  }
}
Program: 41996
Project: 41996
Buggy source:
private void installNewPackageLI(PackageParser.Package pkg,int parseFlags,int scanMode,String installerPackageName,PackageInstalledInfo res){
  String pkgName=pkg.packageName;
  boolean dataDirExists=getDataPathForPackage(pkg).exists();
  res.name=pkgName;
synchronized (mPackages) {
    if (mPackages.containsKey(pkgName) || mAppDirs.containsKey(pkg.mPath)) {
      Slog.w(TAG,"String_Node_Str" + pkgName + "String_Node_Str");
      res.returnCode=PackageManager.INSTALL_FAILED_ALREADY_EXISTS;
      return;
    }
  }
  mLastScanError=PackageManager.INSTALL_SUCCEEDED;
  PackageParser.Package newPackage=scanPackageLI(pkg,parseFlags,scanMode);
  if (newPackage == null) {
    Slog.w(TAG,"String_Node_Str" + pkg.mPath);
    if ((res.returnCode=mLastScanError) == PackageManager.INSTALL_SUCCEEDED) {
      res.returnCode=PackageManager.INSTALL_FAILED_INVALID_APK;
    }
  }
 else {
    updateSettingsLI(newPackage,installerPackageName,res);
    if (res.returnCode != PackageManager.INSTALL_SUCCEEDED) {
      deletePackageLI(pkgName,false,dataDirExists ? PackageManager.DONT_DELETE_DATA : 0,res.removedInfo);
    }
  }
}

Fixed version (ground truth):
private void installNewPackageLI(PackageParser.Package pkg,int parseFlags,int scanMode,String installerPackageName,PackageInstalledInfo res){
  String pkgName=pkg.packageName;
  boolean dataDirExists=getDataPathForPackage(pkg).exists();
  res.name=pkgName;
synchronized (mPackages) {
    if (mSettings.mRenamedPackages.containsKey(pkgName)) {
      Slog.w(TAG,"String_Node_Str" + pkgName + "String_Node_Str"+ mSettings.mRenamedPackages.get(pkgName));
      res.returnCode=PackageManager.INSTALL_FAILED_ALREADY_EXISTS;
      return;
    }
    if (mPackages.containsKey(pkgName) || mAppDirs.containsKey(pkg.mPath)) {
      Slog.w(TAG,"String_Node_Str" + pkgName + "String_Node_Str");
      res.returnCode=PackageManager.INSTALL_FAILED_ALREADY_EXISTS;
      return;
    }
  }
  mLastScanError=PackageManager.INSTALL_SUCCEEDED;
  PackageParser.Package newPackage=scanPackageLI(pkg,parseFlags,scanMode);
  if (newPackage == null) {
    Slog.w(TAG,"String_Node_Str" + pkg.mPath);
    if ((res.returnCode=mLastScanError) == PackageManager.INSTALL_SUCCEEDED) {
      res.returnCode=PackageManager.INSTALL_FAILED_INVALID_APK;
    }
  }
 else {
    updateSettingsLI(newPackage,installerPackageName,res);
    if (res.returnCode != PackageManager.INSTALL_SUCCEEDED) {
      deletePackageLI(pkgName,false,dataDirExists ? PackageManager.DONT_DELETE_DATA : 0,res.removedInfo);
    }
  }
}