nus-yam/ex-repair huggingface dataset:
Program: 41481
Project: 41481
Buggy source:
@SuppressWarnings("String_Node_Str") private static void dispatchMotionEvent(InputHandler inputHandler,MotionEvent event,long finishedToken){
  Runnable finishedCallback=new FinishedCallback(finishedToken);
  inputHandler.handleMotion(event,finishedCallback);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static void dispatchMotionEvent(InputHandler inputHandler,MotionEvent event,long finishedToken){
  Runnable finishedCallback=FinishedCallback.obtain(finishedToken);
  inputHandler.handleMotion(event,finishedCallback);
}
Program: 41482
Project: 41482
Buggy source:
@SuppressWarnings("String_Node_Str") private static void dispatchKeyEvent(InputHandler inputHandler,KeyEvent event,long finishedToken){
  Runnable finishedCallback=new FinishedCallback(finishedToken);
  inputHandler.handleKey(event,finishedCallback);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static void dispatchKeyEvent(InputHandler inputHandler,KeyEvent event,long finishedToken){
  Runnable finishedCallback=FinishedCallback.obtain(finishedToken);
  inputHandler.handleKey(event,finishedCallback);
}
Program: 41483
Project: 41483
Buggy source:
public void run(){
synchronized (sLock) {
    nativeFinished(mFinishedToken);
  }
}

Fixed version (ground truth):
public void run(){
synchronized (sLock) {
    if (mFinishedToken == -1) {
      throw new IllegalStateException("String_Node_Str");
    }
    nativeFinished(mFinishedToken);
    mFinishedToken=-1;
    if (sRecycleCount < RECYCLE_MAX_COUNT) {
      mRecycleNext=sRecycleHead;
      sRecycleHead=this;
      sRecycleCount+=1;
      if (DEBUG_RECYCLING) {
        Slog.d(TAG,"String_Node_Str" + sRecycleCount);
      }
    }
  }
}
Program: 41484
Project: 41484
Buggy source:
public FinishedCallback(long finishedToken){
  mFinishedToken=finishedToken;
}

Fixed version (ground truth):
private FinishedCallback(){
}
Program: 41486
Project: 41486
Buggy source:
@SuppressWarnings("String_Node_Str") private static void dispatchMotionEvent(InputHandler inputHandler,MotionEvent event,long finishedToken){
  Runnable finishedCallback=new FinishedCallback(finishedToken);
  inputHandler.handleMotion(event,finishedCallback);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static void dispatchMotionEvent(InputHandler inputHandler,MotionEvent event,long finishedToken){
  Runnable finishedCallback=FinishedCallback.obtain(finishedToken);
  inputHandler.handleMotion(event,finishedCallback);
}
Program: 41487
Project: 41487
Buggy source:
@SuppressWarnings("String_Node_Str") private static void dispatchKeyEvent(InputHandler inputHandler,KeyEvent event,long finishedToken){
  Runnable finishedCallback=new FinishedCallback(finishedToken);
  inputHandler.handleKey(event,finishedCallback);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static void dispatchKeyEvent(InputHandler inputHandler,KeyEvent event,long finishedToken){
  Runnable finishedCallback=FinishedCallback.obtain(finishedToken);
  inputHandler.handleKey(event,finishedCallback);
}
Program: 41488
Project: 41488
Buggy source:
public void run(){
synchronized (sLock) {
    nativeFinished(mFinishedToken);
  }
}

Fixed version (ground truth):
public void run(){
synchronized (sLock) {
    if (mFinishedToken == -1) {
      throw new IllegalStateException("String_Node_Str");
    }
    nativeFinished(mFinishedToken);
    mFinishedToken=-1;
    if (sRecycleCount < RECYCLE_MAX_COUNT) {
      mRecycleNext=sRecycleHead;
      sRecycleHead=this;
      sRecycleCount+=1;
      if (DEBUG_RECYCLING) {
        Slog.d(TAG,"String_Node_Str" + sRecycleCount);
      }
    }
  }
}
Program: 41489
Project: 41489
Buggy source:
public FinishedCallback(long finishedToken){
  mFinishedToken=finishedToken;
}

Fixed version (ground truth):
private FinishedCallback(){
}
Program: 41493
Project: 41493
Buggy source:
/** 
 * Call this when you want to know the new location.  If it returns true, the animation is not yet finished.  loc will be altered to provide the new location.
 */
public boolean computeScrollOffset(){
  if (mFinished) {
    return false;
  }
  int timePassed=(int)(AnimationUtils.currentAnimationTimeMillis() - mStartTime);
  if (timePassed < mDuration) {
switch (mMode) {
case SCROLL_MODE:
      float x=(float)timePassed * mDurationReciprocal;
    if (mInterpolator == null)     x=viscousFluid(x);
 else     x=mInterpolator.getInterpolation(x);
  mCurrX=mStartX + Math.round(x * mDeltaX);
mCurrY=mStartY + Math.round(x * mDeltaY);
break;
case FLING_MODE:
float timePassedSeconds=timePassed / 1000.0f;
float distance=(mVelocity * timePassedSeconds) - (mDeceleration * timePassedSeconds * timePassedSeconds / 2.0f);
mCurrX=mStartX + Math.round(distance * mCoeffX);
mCurrX=Math.min(mCurrX,mMaxX);
mCurrX=Math.max(mCurrX,mMinX);
mCurrY=mStartY + Math.round(distance * mCoeffY);
mCurrY=Math.min(mCurrY,mMaxY);
mCurrY=Math.max(mCurrY,mMinY);
break;
}
}
 else {
mCurrX=mFinalX;
mCurrY=mFinalY;
mFinished=true;
}
return true;
}

Fixed version (ground truth):
/** 
 * Call this when you want to know the new location.  If it returns true, the animation is not yet finished.  loc will be altered to provide the new location.
 */
public boolean computeScrollOffset(){
  if (mFinished) {
    return false;
  }
  int timePassed=(int)(AnimationUtils.currentAnimationTimeMillis() - mStartTime);
  if (timePassed < mDuration) {
switch (mMode) {
case SCROLL_MODE:
      float x=(float)timePassed * mDurationReciprocal;
    if (mInterpolator == null)     x=viscousFluid(x);
 else     x=mInterpolator.getInterpolation(x);
  mCurrX=mStartX + Math.round(x * mDeltaX);
mCurrY=mStartY + Math.round(x * mDeltaY);
break;
case FLING_MODE:
float timePassedSeconds=timePassed / 1000.0f;
float distance=(mVelocity * timePassedSeconds) - (mDeceleration * timePassedSeconds * timePassedSeconds / 2.0f);
mCurrX=mStartX + Math.round(distance * mCoeffX);
mCurrX=Math.min(mCurrX,mMaxX);
mCurrX=Math.max(mCurrX,mMinX);
mCurrY=mStartY + Math.round(distance * mCoeffY);
mCurrY=Math.min(mCurrY,mMaxY);
mCurrY=Math.max(mCurrY,mMinY);
if (mCurrX == mFinalX && mCurrY == mFinalY) {
mFinished=true;
}
break;
}
}
 else {
mCurrX=mFinalX;
mCurrY=mFinalY;
mFinished=true;
}
return true;
}
Program: 41494
Project: 41494
Buggy source:
/** 
 * Call this when you want to know the new location.  If it returns true, the animation is not yet finished.  loc will be altered to provide the new location.
 */
public boolean computeScrollOffset(){
  if (mFinished) {
    return false;
  }
  int timePassed=(int)(AnimationUtils.currentAnimationTimeMillis() - mStartTime);
  if (timePassed < mDuration) {
switch (mMode) {
case SCROLL_MODE:
      float x=(float)timePassed * mDurationReciprocal;
    if (mInterpolator == null)     x=viscousFluid(x);
 else     x=mInterpolator.getInterpolation(x);
  mCurrX=mStartX + Math.round(x * mDeltaX);
mCurrY=mStartY + Math.round(x * mDeltaY);
break;
case FLING_MODE:
float timePassedSeconds=timePassed / 1000.0f;
float distance=(mVelocity * timePassedSeconds) - (mDeceleration * timePassedSeconds * timePassedSeconds / 2.0f);
mCurrX=mStartX + Math.round(distance * mCoeffX);
mCurrX=Math.min(mCurrX,mMaxX);
mCurrX=Math.max(mCurrX,mMinX);
mCurrY=mStartY + Math.round(distance * mCoeffY);
mCurrY=Math.min(mCurrY,mMaxY);
mCurrY=Math.max(mCurrY,mMinY);
break;
}
}
 else {
mCurrX=mFinalX;
mCurrY=mFinalY;
mFinished=true;
}
return true;
}

Fixed version (ground truth):
/** 
 * Call this when you want to know the new location.  If it returns true, the animation is not yet finished.  loc will be altered to provide the new location.
 */
public boolean computeScrollOffset(){
  if (mFinished) {
    return false;
  }
  int timePassed=(int)(AnimationUtils.currentAnimationTimeMillis() - mStartTime);
  if (timePassed < mDuration) {
switch (mMode) {
case SCROLL_MODE:
      float x=(float)timePassed * mDurationReciprocal;
    if (mInterpolator == null)     x=viscousFluid(x);
 else     x=mInterpolator.getInterpolation(x);
  mCurrX=mStartX + Math.round(x * mDeltaX);
mCurrY=mStartY + Math.round(x * mDeltaY);
break;
case FLING_MODE:
float timePassedSeconds=timePassed / 1000.0f;
float distance=(mVelocity * timePassedSeconds) - (mDeceleration * timePassedSeconds * timePassedSeconds / 2.0f);
mCurrX=mStartX + Math.round(distance * mCoeffX);
mCurrX=Math.min(mCurrX,mMaxX);
mCurrX=Math.max(mCurrX,mMinX);
mCurrY=mStartY + Math.round(distance * mCoeffY);
mCurrY=Math.min(mCurrY,mMaxY);
mCurrY=Math.max(mCurrY,mMinY);
if (mCurrX == mFinalX && mCurrY == mFinalY) {
mFinished=true;
}
break;
}
}
 else {
mCurrX=mFinalX;
mCurrY=mFinalY;
mFinished=true;
}
return true;
}
Program: 41501
Project: 41501
Buggy source:
synchronized void getAllProperties(){
  mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM,"String_Node_Str");
  mAdapterProperties.clear();
  String properties[]=(String[])getAdapterPropertiesNative();
  if (properties == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  for (int i=0; i < properties.length; i++) {
    String name=properties[i];
    String newValue=null;
    int len;
    if (name == null) {
      Log.e(TAG,"String_Node_Str" + i + "String_Node_Str");
      continue;
    }
    if (name.equals("String_Node_Str")) {
      StringBuilder str=new StringBuilder();
      len=Integer.valueOf(properties[++i]);
      for (int j=0; j < len; j++) {
        str.append(properties[++i]);
        str.append("String_Node_Str");
      }
      if (len > 0) {
        newValue=str.toString();
      }
    }
 else {
      newValue=properties[++i];
    }
    mAdapterProperties.put(name,newValue);
  }
  String adapterPath=getAdapterPathNative();
  if (adapterPath != null)   mAdapterProperties.put("String_Node_Str",adapterPath + "String_Node_Str");
}

Fixed version (ground truth):
synchronized void getAllProperties(){
  mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM,"String_Node_Str");
  mAdapterProperties.clear();
  String properties[]=(String[])getAdapterPropertiesNative();
  if (properties == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  for (int i=0; i < properties.length; i++) {
    String name=properties[i];
    String newValue=null;
    int len;
    if (name == null) {
      Log.e(TAG,"String_Node_Str" + i + "String_Node_Str");
      continue;
    }
    if (name.equals("String_Node_Str") || name.equals("String_Node_Str")) {
      StringBuilder str=new StringBuilder();
      len=Integer.valueOf(properties[++i]);
      for (int j=0; j < len; j++) {
        str.append(properties[++i]);
        str.append("String_Node_Str");
      }
      if (len > 0) {
        newValue=str.toString();
      }
    }
 else {
      newValue=properties[++i];
    }
    mAdapterProperties.put(name,newValue);
  }
  String adapterPath=getAdapterPathNative();
  if (adapterPath != null)   mAdapterProperties.put("String_Node_Str",adapterPath + "String_Node_Str");
}
Program: 41502
Project: 41502
Buggy source:
synchronized void getAllProperties(){
  mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM,"String_Node_Str");
  mAdapterProperties.clear();
  String properties[]=(String[])getAdapterPropertiesNative();
  if (properties == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  for (int i=0; i < properties.length; i++) {
    String name=properties[i];
    String newValue=null;
    int len;
    if (name == null) {
      Log.e(TAG,"String_Node_Str" + i + "String_Node_Str");
      continue;
    }
    if (name.equals("String_Node_Str")) {
      StringBuilder str=new StringBuilder();
      len=Integer.valueOf(properties[++i]);
      for (int j=0; j < len; j++) {
        str.append(properties[++i]);
        str.append("String_Node_Str");
      }
      if (len > 0) {
        newValue=str.toString();
      }
    }
 else {
      newValue=properties[++i];
    }
    mAdapterProperties.put(name,newValue);
  }
  String adapterPath=getAdapterPathNative();
  if (adapterPath != null)   mAdapterProperties.put("String_Node_Str",adapterPath + "String_Node_Str");
}

Fixed version (ground truth):
synchronized void getAllProperties(){
  mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM,"String_Node_Str");
  mAdapterProperties.clear();
  String properties[]=(String[])getAdapterPropertiesNative();
  if (properties == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  for (int i=0; i < properties.length; i++) {
    String name=properties[i];
    String newValue=null;
    int len;
    if (name == null) {
      Log.e(TAG,"String_Node_Str" + i + "String_Node_Str");
      continue;
    }
    if (name.equals("String_Node_Str") || name.equals("String_Node_Str")) {
      StringBuilder str=new StringBuilder();
      len=Integer.valueOf(properties[++i]);
      for (int j=0; j < len; j++) {
        str.append(properties[++i]);
        str.append("String_Node_Str");
      }
      if (len > 0) {
        newValue=str.toString();
      }
    }
 else {
      newValue=properties[++i];
    }
    mAdapterProperties.put(name,newValue);
  }
  String adapterPath=getAdapterPathNative();
  if (adapterPath != null)   mAdapterProperties.put("String_Node_Str",adapterPath + "String_Node_Str");
}
Program: 41503
Project: 41503
Buggy source:
/** 
 * Insert new rows (no where clause allowed). 
 */
SqlArguments(Uri url){
  if (url.getPathSegments().size() == 1) {
    this.table=url.getPathSegments().get(0);
    this.where=null;
    this.args=null;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
}

Fixed version (ground truth):
/** 
 * Insert new rows (no where clause allowed). 
 */
SqlArguments(Uri url){
  if (url.getPathSegments().size() == 1) {
    this.table=url.getPathSegments().get(0);
    if (!DatabaseHelper.isValidTable(this.table)) {
      throw new IllegalArgumentException("String_Node_Str" + this.table);
    }
    this.where=null;
    this.args=null;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
}
Program: 41504
Project: 41504
Buggy source:
/** 
 * Insert new rows (no where clause allowed). 
 */
SqlArguments(Uri url){
  if (url.getPathSegments().size() == 1) {
    this.table=url.getPathSegments().get(0);
    this.where=null;
    this.args=null;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
}

Fixed version (ground truth):
/** 
 * Insert new rows (no where clause allowed). 
 */
SqlArguments(Uri url){
  if (url.getPathSegments().size() == 1) {
    this.table=url.getPathSegments().get(0);
    if (!DatabaseHelper.isValidTable(this.table)) {
      throw new IllegalArgumentException("String_Node_Str" + this.table);
    }
    this.where=null;
    this.args=null;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
}
Program: 41505
Project: 41505
Buggy source:
/** 
 * Insert new rows (no where clause allowed). 
 */
SqlArguments(Uri url){
  if (url.getPathSegments().size() == 1) {
    this.table=url.getPathSegments().get(0);
    this.where=null;
    this.args=null;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
}

Fixed version (ground truth):
/** 
 * Insert new rows (no where clause allowed). 
 */
SqlArguments(Uri url){
  if (url.getPathSegments().size() == 1) {
    this.table=url.getPathSegments().get(0);
    if (!DatabaseHelper.isValidTable(this.table)) {
      throw new IllegalArgumentException("String_Node_Str" + this.table);
    }
    this.where=null;
    this.args=null;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
}
Program: 41506
Project: 41506
Buggy source:
/** 
 * Insert new rows (no where clause allowed). 
 */
SqlArguments(Uri url){
  if (url.getPathSegments().size() == 1) {
    this.table=url.getPathSegments().get(0);
    this.where=null;
    this.args=null;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
}

Fixed version (ground truth):
/** 
 * Insert new rows (no where clause allowed). 
 */
SqlArguments(Uri url){
  if (url.getPathSegments().size() == 1) {
    this.table=url.getPathSegments().get(0);
    if (!DatabaseHelper.isValidTable(this.table)) {
      throw new IllegalArgumentException("String_Node_Str" + this.table);
    }
    this.where=null;
    this.args=null;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
}
Program: 41507
Project: 41507
Buggy source:
public static String getAudioCodecName(int audioEncoder){
  if (audioEncoder != MediaRecorder.AudioEncoder.AMR_NB && audioEncoder != MediaRecorder.AudioEncoder.AMR_WB && audioEncoder != MediaRecorder.AudioEncoder.AAC && audioEncoder != MediaRecorder.AudioEncoder.AAC_PLUS && audioEncoder != MediaRecorder.AudioEncoder.EAAC_PLUS) {
    throw new IllegalArgumentException("String_Node_Str" + audioEncoder);
  }
  return encoderMap.get(audioEncoder);
}

Fixed version (ground truth):
public static String getAudioCodecName(int audioEncoder){
  if (audioEncoder != MediaRecorder.AudioEncoder.AMR_NB && audioEncoder != MediaRecorder.AudioEncoder.AMR_WB && audioEncoder != MediaRecorder.AudioEncoder.AAC && audioEncoder != MediaRecorder.AudioEncoder.AAC_PLUS && audioEncoder != MediaRecorder.AudioEncoder.EAAC_PLUS) {
    throw new IllegalArgumentException("String_Node_Str" + audioEncoder);
  }
  return audioEncoderMap.get(audioEncoder);
}
Program: 41508
Project: 41508
Buggy source:
public static String getVideoCodecName(int videoEncoder){
  if (videoEncoder != MediaRecorder.VideoEncoder.H263 && videoEncoder != MediaRecorder.VideoEncoder.H264 && videoEncoder != MediaRecorder.VideoEncoder.MPEG_4_SP) {
    throw new IllegalArgumentException("String_Node_Str" + videoEncoder);
  }
  return encoderMap.get(videoEncoder);
}

Fixed version (ground truth):
public static String getVideoCodecName(int videoEncoder){
  if (videoEncoder != MediaRecorder.VideoEncoder.H263 && videoEncoder != MediaRecorder.VideoEncoder.H264 && videoEncoder != MediaRecorder.VideoEncoder.MPEG_4_SP) {
    throw new IllegalArgumentException("String_Node_Str" + videoEncoder);
  }
  return videoEncoderMap.get(videoEncoder);
}
Program: 41509
Project: 41509
Buggy source:
public static String getAudioCodecName(int audioEncoder){
  if (audioEncoder != MediaRecorder.AudioEncoder.AMR_NB && audioEncoder != MediaRecorder.AudioEncoder.AMR_WB && audioEncoder != MediaRecorder.AudioEncoder.AAC && audioEncoder != MediaRecorder.AudioEncoder.AAC_PLUS && audioEncoder != MediaRecorder.AudioEncoder.EAAC_PLUS) {
    throw new IllegalArgumentException("String_Node_Str" + audioEncoder);
  }
  return encoderMap.get(audioEncoder);
}

Fixed version (ground truth):
public static String getAudioCodecName(int audioEncoder){
  if (audioEncoder != MediaRecorder.AudioEncoder.AMR_NB && audioEncoder != MediaRecorder.AudioEncoder.AMR_WB && audioEncoder != MediaRecorder.AudioEncoder.AAC && audioEncoder != MediaRecorder.AudioEncoder.AAC_PLUS && audioEncoder != MediaRecorder.AudioEncoder.EAAC_PLUS) {
    throw new IllegalArgumentException("String_Node_Str" + audioEncoder);
  }
  return audioEncoderMap.get(audioEncoder);
}
Program: 41510
Project: 41510
Buggy source:
public static String getVideoCodecName(int videoEncoder){
  if (videoEncoder != MediaRecorder.VideoEncoder.H263 && videoEncoder != MediaRecorder.VideoEncoder.H264 && videoEncoder != MediaRecorder.VideoEncoder.MPEG_4_SP) {
    throw new IllegalArgumentException("String_Node_Str" + videoEncoder);
  }
  return encoderMap.get(videoEncoder);
}

Fixed version (ground truth):
public static String getVideoCodecName(int videoEncoder){
  if (videoEncoder != MediaRecorder.VideoEncoder.H263 && videoEncoder != MediaRecorder.VideoEncoder.H264 && videoEncoder != MediaRecorder.VideoEncoder.MPEG_4_SP) {
    throw new IllegalArgumentException("String_Node_Str" + videoEncoder);
  }
  return videoEncoderMap.get(videoEncoder);
}
Program: 41511
Project: 41511
Buggy source:
public void clearCount(boolean stopSco){
synchronized (mScoClients) {
    mStartcount=0;
    mCb.unlinkToDeath(this,0);
    if (stopSco) {
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}

Fixed version (ground truth):
public void clearCount(boolean stopSco){
synchronized (mScoClients) {
    if (mStartcount != 0) {
      try {
        mCb.unlinkToDeath(this,0);
      }
 catch (      NoSuchElementException e) {
        Log.w(TAG,"String_Node_Str" + mStartcount + "String_Node_Str");
      }
    }
    mStartcount=0;
    if (stopSco) {
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}
Program: 41512
Project: 41512
Buggy source:
public void decCount(){
synchronized (mScoClients) {
    if (mStartcount == 0) {
      Log.w(TAG,"String_Node_Str");
    }
 else {
      mStartcount--;
      if (mStartcount == 0) {
        mCb.unlinkToDeath(this,0);
      }
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}

Fixed version (ground truth):
public void decCount(){
synchronized (mScoClients) {
    if (mStartcount == 0) {
      Log.w(TAG,"String_Node_Str");
    }
 else {
      mStartcount--;
      if (mStartcount == 0) {
        try {
          mCb.unlinkToDeath(this,0);
        }
 catch (        NoSuchElementException e) {
          Log.w(TAG,"String_Node_Str");
        }
      }
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}
Program: 41513
Project: 41513
Buggy source:
public void clearCount(boolean stopSco){
synchronized (mScoClients) {
    mStartcount=0;
    mCb.unlinkToDeath(this,0);
    if (stopSco) {
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}

Fixed version (ground truth):
public void clearCount(boolean stopSco){
synchronized (mScoClients) {
    if (mStartcount != 0) {
      try {
        mCb.unlinkToDeath(this,0);
      }
 catch (      NoSuchElementException e) {
        Log.w(TAG,"String_Node_Str" + mStartcount + "String_Node_Str");
      }
    }
    mStartcount=0;
    if (stopSco) {
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}
Program: 41514
Project: 41514
Buggy source:
public void decCount(){
synchronized (mScoClients) {
    if (mStartcount == 0) {
      Log.w(TAG,"String_Node_Str");
    }
 else {
      mStartcount--;
      if (mStartcount == 0) {
        mCb.unlinkToDeath(this,0);
      }
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}

Fixed version (ground truth):
public void decCount(){
synchronized (mScoClients) {
    if (mStartcount == 0) {
      Log.w(TAG,"String_Node_Str");
    }
 else {
      mStartcount--;
      if (mStartcount == 0) {
        try {
          mCb.unlinkToDeath(this,0);
        }
 catch (        NoSuchElementException e) {
          Log.w(TAG,"String_Node_Str");
        }
      }
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}
Program: 41515
Project: 41515
Buggy source:
public void clearCount(boolean stopSco){
synchronized (mScoClients) {
    mStartcount=0;
    mCb.unlinkToDeath(this,0);
    if (stopSco) {
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}

Fixed version (ground truth):
public void clearCount(boolean stopSco){
synchronized (mScoClients) {
    if (mStartcount != 0) {
      try {
        mCb.unlinkToDeath(this,0);
      }
 catch (      NoSuchElementException e) {
        Log.w(TAG,"String_Node_Str" + mStartcount + "String_Node_Str");
      }
    }
    mStartcount=0;
    if (stopSco) {
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}
Program: 41516
Project: 41516
Buggy source:
public void decCount(){
synchronized (mScoClients) {
    if (mStartcount == 0) {
      Log.w(TAG,"String_Node_Str");
    }
 else {
      mStartcount--;
      if (mStartcount == 0) {
        mCb.unlinkToDeath(this,0);
      }
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}

Fixed version (ground truth):
public void decCount(){
synchronized (mScoClients) {
    if (mStartcount == 0) {
      Log.w(TAG,"String_Node_Str");
    }
 else {
      mStartcount--;
      if (mStartcount == 0) {
        try {
          mCb.unlinkToDeath(this,0);
        }
 catch (        NoSuchElementException e) {
          Log.w(TAG,"String_Node_Str");
        }
      }
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}
Program: 41517
Project: 41517
Buggy source:
public void clearCount(boolean stopSco){
synchronized (mScoClients) {
    mStartcount=0;
    mCb.unlinkToDeath(this,0);
    if (stopSco) {
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}

Fixed version (ground truth):
public void clearCount(boolean stopSco){
synchronized (mScoClients) {
    if (mStartcount != 0) {
      try {
        mCb.unlinkToDeath(this,0);
      }
 catch (      NoSuchElementException e) {
        Log.w(TAG,"String_Node_Str" + mStartcount + "String_Node_Str");
      }
    }
    mStartcount=0;
    if (stopSco) {
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}
Program: 41518
Project: 41518
Buggy source:
public void decCount(){
synchronized (mScoClients) {
    if (mStartcount == 0) {
      Log.w(TAG,"String_Node_Str");
    }
 else {
      mStartcount--;
      if (mStartcount == 0) {
        mCb.unlinkToDeath(this,0);
      }
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}

Fixed version (ground truth):
public void decCount(){
synchronized (mScoClients) {
    if (mStartcount == 0) {
      Log.w(TAG,"String_Node_Str");
    }
 else {
      mStartcount--;
      if (mStartcount == 0) {
        try {
          mCb.unlinkToDeath(this,0);
        }
 catch (        NoSuchElementException e) {
          Log.w(TAG,"String_Node_Str");
        }
      }
      requestScoState(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
    }
  }
}
Program: 41527
Project: 41527
Buggy source:
static boolean isDnsReachable(int dns,int timeout){
  try {
    DatagramSocket socket=new DatagramSocket();
    socket.setSoTimeout(timeout);
    byte[] buf=new byte[DNS_QUERY_BASE_SIZE];
    fillQuery(buf);
    byte parts[]=new byte[4];
    parts[0]=(byte)(dns & 0xff);
    parts[1]=(byte)((dns >> 8) & 0xff);
    parts[2]=(byte)((dns >> 16) & 0xff);
    parts[3]=(byte)((dns >> 24) & 0xff);
    InetAddress dnsAddress=InetAddress.getByAddress(parts);
    DatagramPacket packet=new DatagramPacket(buf,buf.length,dnsAddress,DNS_PORT);
    socket.send(packet);
    DatagramPacket replyPacket=new DatagramPacket(buf,buf.length);
    socket.receive(replyPacket);
    return true;
  }
 catch (  SocketException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  UnknownHostException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  SocketTimeoutException e) {
    return false;
  }
catch (  IOException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  Exception e) {
    if (V || Config.LOGD) {
      Slog.d(TAG,"String_Node_Str",e);
    }
    return false;
  }
}

Fixed version (ground truth):
static boolean isDnsReachable(int dns,int timeout){
  DatagramSocket socket=null;
  try {
    socket=new DatagramSocket();
    socket.setSoTimeout(timeout);
    byte[] buf=new byte[DNS_QUERY_BASE_SIZE];
    fillQuery(buf);
    byte parts[]=new byte[4];
    parts[0]=(byte)(dns & 0xff);
    parts[1]=(byte)((dns >> 8) & 0xff);
    parts[2]=(byte)((dns >> 16) & 0xff);
    parts[3]=(byte)((dns >> 24) & 0xff);
    InetAddress dnsAddress=InetAddress.getByAddress(parts);
    DatagramPacket packet=new DatagramPacket(buf,buf.length,dnsAddress,DNS_PORT);
    socket.send(packet);
    DatagramPacket replyPacket=new DatagramPacket(buf,buf.length);
    socket.receive(replyPacket);
    return true;
  }
 catch (  SocketException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  UnknownHostException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  SocketTimeoutException e) {
    return false;
  }
catch (  IOException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  Exception e) {
    if (V || Config.LOGD) {
      Slog.d(TAG,"String_Node_Str",e);
    }
    return false;
  }
 finally {
    if (socket != null) {
      socket.close();
    }
  }
}
Program: 41529
Project: 41529
Buggy source:
static boolean isDnsReachable(int dns,int timeout){
  try {
    DatagramSocket socket=new DatagramSocket();
    socket.setSoTimeout(timeout);
    byte[] buf=new byte[DNS_QUERY_BASE_SIZE];
    fillQuery(buf);
    byte parts[]=new byte[4];
    parts[0]=(byte)(dns & 0xff);
    parts[1]=(byte)((dns >> 8) & 0xff);
    parts[2]=(byte)((dns >> 16) & 0xff);
    parts[3]=(byte)((dns >> 24) & 0xff);
    InetAddress dnsAddress=InetAddress.getByAddress(parts);
    DatagramPacket packet=new DatagramPacket(buf,buf.length,dnsAddress,DNS_PORT);
    socket.send(packet);
    DatagramPacket replyPacket=new DatagramPacket(buf,buf.length);
    socket.receive(replyPacket);
    return true;
  }
 catch (  SocketException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  UnknownHostException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  SocketTimeoutException e) {
    return false;
  }
catch (  IOException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  Exception e) {
    if (V || Config.LOGD) {
      Slog.d(TAG,"String_Node_Str",e);
    }
    return false;
  }
}

Fixed version (ground truth):
static boolean isDnsReachable(int dns,int timeout){
  DatagramSocket socket=null;
  try {
    socket=new DatagramSocket();
    socket.setSoTimeout(timeout);
    byte[] buf=new byte[DNS_QUERY_BASE_SIZE];
    fillQuery(buf);
    byte parts[]=new byte[4];
    parts[0]=(byte)(dns & 0xff);
    parts[1]=(byte)((dns >> 8) & 0xff);
    parts[2]=(byte)((dns >> 16) & 0xff);
    parts[3]=(byte)((dns >> 24) & 0xff);
    InetAddress dnsAddress=InetAddress.getByAddress(parts);
    DatagramPacket packet=new DatagramPacket(buf,buf.length,dnsAddress,DNS_PORT);
    socket.send(packet);
    DatagramPacket replyPacket=new DatagramPacket(buf,buf.length);
    socket.receive(replyPacket);
    return true;
  }
 catch (  SocketException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  UnknownHostException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  SocketTimeoutException e) {
    return false;
  }
catch (  IOException e) {
    if (V) {
      Slog.v(TAG,"String_Node_Str",e);
    }
    return false;
  }
catch (  Exception e) {
    if (V || Config.LOGD) {
      Slog.d(TAG,"String_Node_Str",e);
    }
    return false;
  }
 finally {
    if (socket != null) {
      socket.close();
    }
  }
}
Program: 41530
Project: 41530
Buggy source:
public void removePackageFromPreferred(String packageName){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS,null);
  Slog.w(TAG,"String_Node_Str");
}

Fixed version (ground truth):
public void removePackageFromPreferred(String packageName){
  Slog.w(TAG,"String_Node_Str");
}
Program: 41531
Project: 41531
Buggy source:
public void addPackageToPreferred(String packageName){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS,null);
  Slog.w(TAG,"String_Node_Str");
}

Fixed version (ground truth):
public void addPackageToPreferred(String packageName){
  Slog.w(TAG,"String_Node_Str");
}
Program: 41532
Project: 41532
Buggy source:
public void removePackageFromPreferred(String packageName){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS,null);
  Slog.w(TAG,"String_Node_Str");
}

Fixed version (ground truth):
public void removePackageFromPreferred(String packageName){
  Slog.w(TAG,"String_Node_Str");
}
Program: 41533
Project: 41533
Buggy source:
public void addPackageToPreferred(String packageName){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS,null);
  Slog.w(TAG,"String_Node_Str");
}

Fixed version (ground truth):
public void addPackageToPreferred(String packageName){
  Slog.w(TAG,"String_Node_Str");
}
Program: 41534
Project: 41534
Buggy source:
public void removePackageFromPreferred(String packageName){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS,null);
  Slog.w(TAG,"String_Node_Str");
}

Fixed version (ground truth):
public void removePackageFromPreferred(String packageName){
  Slog.w(TAG,"String_Node_Str");
}
Program: 41535
Project: 41535
Buggy source:
public void addPackageToPreferred(String packageName){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS,null);
  Slog.w(TAG,"String_Node_Str");
}

Fixed version (ground truth):
public void addPackageToPreferred(String packageName){
  Slog.w(TAG,"String_Node_Str");
}
Program: 41536
Project: 41536
Buggy source:
/** 
 * Recycle the MotionEvent, to be re-used by a later caller.  After calling this function you must not ever touch the event again.
 */
public void recycle(){
  if (TRACK_RECYCLED_LOCATION) {
    if (mRecycledLocation != null) {
      throw new RuntimeException(toString() + "String_Node_Str",mRecycledLocation);
    }
    mRecycledLocation=new RuntimeException("String_Node_Str");
  }
 else   if (mRecycled) {
    throw new RuntimeException(toString() + "String_Node_Str");
  }
synchronized (gRecyclerLock) {
    if (gRecyclerUsed < MAX_RECYCLED) {
      gRecyclerUsed++;
      mNumSamples=0;
      mNext=gRecyclerTop;
      gRecyclerTop=this;
    }
  }
}

Fixed version (ground truth):
/** 
 * Recycle the MotionEvent, to be re-used by a later caller.  After calling this function you must not ever touch the event again.
 */
public void recycle(){
  if (TRACK_RECYCLED_LOCATION) {
    if (mRecycledLocation != null) {
      throw new RuntimeException(toString() + "String_Node_Str",mRecycledLocation);
    }
    mRecycledLocation=new RuntimeException("String_Node_Str");
  }
 else {
    if (mRecycled) {
      throw new RuntimeException(toString() + "String_Node_Str");
    }
    mRecycled=true;
  }
synchronized (gRecyclerLock) {
    if (gRecyclerUsed < MAX_RECYCLED) {
      gRecyclerUsed++;
      mNumSamples=0;
      mNext=gRecyclerTop;
      gRecyclerTop=this;
    }
  }
}
Program: 41537
Project: 41537
Buggy source:
/** 
 * Recycle the MotionEvent, to be re-used by a later caller.  After calling this function you must not ever touch the event again.
 */
public void recycle(){
  if (TRACK_RECYCLED_LOCATION) {
    if (mRecycledLocation != null) {
      throw new RuntimeException(toString() + "String_Node_Str",mRecycledLocation);
    }
    mRecycledLocation=new RuntimeException("String_Node_Str");
  }
 else   if (mRecycled) {
    throw new RuntimeException(toString() + "String_Node_Str");
  }
synchronized (gRecyclerLock) {
    if (gRecyclerUsed < MAX_RECYCLED) {
      gRecyclerUsed++;
      mNumSamples=0;
      mNext=gRecyclerTop;
      gRecyclerTop=this;
    }
  }
}

Fixed version (ground truth):
/** 
 * Recycle the MotionEvent, to be re-used by a later caller.  After calling this function you must not ever touch the event again.
 */
public void recycle(){
  if (TRACK_RECYCLED_LOCATION) {
    if (mRecycledLocation != null) {
      throw new RuntimeException(toString() + "String_Node_Str",mRecycledLocation);
    }
    mRecycledLocation=new RuntimeException("String_Node_Str");
  }
 else {
    if (mRecycled) {
      throw new RuntimeException(toString() + "String_Node_Str");
    }
    mRecycled=true;
  }
synchronized (gRecyclerLock) {
    if (gRecyclerUsed < MAX_RECYCLED) {
      gRecyclerUsed++;
      mNumSamples=0;
      mNext=gRecyclerTop;
      gRecyclerTop=this;
    }
  }
}
Program: 41538
Project: 41538
Buggy source:
public void onItemClick(AdapterView parent,View v,int position,long id){
  onListItemClick((ListView)parent,v,position,id);
}

Fixed version (ground truth):
public void onItemClick(AdapterView<?> parent,View v,int position,long id){
  onListItemClick((ListView)parent,v,position,id);
}
Program: 41539
Project: 41539
Buggy source:
public Boolean geocoderIsImplemented(){
  return mGeocodeProvider != null;
}

Fixed version (ground truth):
public boolean geocoderIsImplemented(){
  return mGeocodeProvider != null;
}
Program: 41540
Project: 41540
Buggy source:
SdInstallArgs(Uri packageURI,String cid){
  super(packageURI,null,PackageManager.INSTALL_EXTERNAL,null);
  this.cid=cid;
  cachePath=PackageHelper.getSdDir(cid);
}

Fixed version (ground truth):
SdInstallArgs(Uri packageURI,String cid){
  super(packageURI,null,PackageManager.INSTALL_EXTERNAL,null);
  this.cid=cid;
}
Program: 41541
Project: 41541
Buggy source:
SdInstallArgs(Uri packageURI,String cid){
  super(packageURI,null,PackageManager.INSTALL_EXTERNAL,null);
  this.cid=cid;
  cachePath=PackageHelper.getSdDir(cid);
}

Fixed version (ground truth):
SdInstallArgs(Uri packageURI,String cid){
  super(packageURI,null,PackageManager.INSTALL_EXTERNAL,null);
  this.cid=cid;
}
Program: 41542
Project: 41542
Buggy source:
SdInstallArgs(Uri packageURI,String cid){
  super(packageURI,null,PackageManager.INSTALL_EXTERNAL,null);
  this.cid=cid;
  cachePath=PackageHelper.getSdDir(cid);
}

Fixed version (ground truth):
SdInstallArgs(Uri packageURI,String cid){
  super(packageURI,null,PackageManager.INSTALL_EXTERNAL,null);
  this.cid=cid;
}
Program: 41543
Project: 41543
Buggy source:
public void onPictureTaken(byte[] rawData,Camera camera){
  try {
    if (rawData != null) {
      int rawDataLength=rawData.length;
      File rawoutput=new File("String_Node_Str");
      FileOutputStream outstream=new FileOutputStream(rawoutput);
      outstream.write(rawData);
      Log.v(TAG,"String_Node_Str" + rawDataLength);
      jpegPictureCallbackResult=true;
    }
 else {
      jpegPictureCallbackResult=false;
    }
    mSnapshotDone.open();
    Log.v(TAG,"String_Node_Str");
  }
 catch (  Exception e) {
    Log.v(TAG,e.toString());
  }
}

Fixed version (ground truth):
public void onPictureTaken(byte[] rawData,Camera camera){
  try {
    if (rawData != null) {
      int rawDataLength=rawData.length;
      File rawoutput=new File(Environment.getExternalStorageDirectory().toString(),"String_Node_Str");
      FileOutputStream outstream=new FileOutputStream(rawoutput);
      outstream.write(rawData);
      Log.v(TAG,"String_Node_Str" + rawDataLength);
      jpegPictureCallbackResult=true;
    }
 else {
      jpegPictureCallbackResult=false;
    }
    mSnapshotDone.open();
    Log.v(TAG,"String_Node_Str");
  }
 catch (  Exception e) {
    Log.v(TAG,e.toString());
  }
}
Program: 41544
Project: 41544
Buggy source:
public void onPictureTaken(byte[] rawData,Camera camera){
  try {
    if (rawData != null) {
      int rawDataLength=rawData.length;
      File rawoutput=new File("String_Node_Str");
      FileOutputStream outstream=new FileOutputStream(rawoutput);
      outstream.write(rawData);
      Log.v(TAG,"String_Node_Str" + rawDataLength);
      jpegPictureCallbackResult=true;
    }
 else {
      jpegPictureCallbackResult=false;
    }
    mSnapshotDone.open();
    Log.v(TAG,"String_Node_Str");
  }
 catch (  Exception e) {
    Log.v(TAG,e.toString());
  }
}

Fixed version (ground truth):
public void onPictureTaken(byte[] rawData,Camera camera){
  try {
    if (rawData != null) {
      int rawDataLength=rawData.length;
      File rawoutput=new File(Environment.getExternalStorageDirectory().toString(),"String_Node_Str");
      FileOutputStream outstream=new FileOutputStream(rawoutput);
      outstream.write(rawData);
      Log.v(TAG,"String_Node_Str" + rawDataLength);
      jpegPictureCallbackResult=true;
    }
 else {
      jpegPictureCallbackResult=false;
    }
    mSnapshotDone.open();
    Log.v(TAG,"String_Node_Str");
  }
 catch (  Exception e) {
    Log.v(TAG,e.toString());
  }
}
Program: 41545
Project: 41545
Buggy source:
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}

Fixed version (ground truth):
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  unregisterAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}
Program: 41546
Project: 41546
Buggy source:
/** 
 * Register a listener for audio focus updates.
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}
Program: 41547
Project: 41547
Buggy source:
/** 
 * TODO document for SDK
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
  IAudioService service=getService();
  try {
    service.unregisterAudioFocusClient(getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}
Program: 41548
Project: 41548
Buggy source:
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
synchronized (mFocusStack) {
    removeFocusStackEntry(clientId,true);
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  try {
synchronized (mAudioFocusLock) {
      removeFocusStackEntry(clientId,true);
    }
  }
 catch (  java.util.ConcurrentModificationException cme) {
    Log.e(TAG,"String_Node_Str" + cme);
    cme.printStackTrace();
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 41549
Project: 41549
Buggy source:
public void binderDied(){
synchronized (mFocusStack) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}

Fixed version (ground truth):
public void binderDied(){
synchronized (mAudioFocusLock) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}
Program: 41550
Project: 41550
Buggy source:
public void unregisterAudioFocusClient(String clientId){
synchronized (mFocusStack) {
    removeFocusStackEntry(clientId,false);
  }
}

Fixed version (ground truth):
public void unregisterAudioFocusClient(String clientId){
synchronized (mAudioFocusLock) {
    removeFocusStackEntry(clientId,false);
  }
}
Program: 41552
Project: 41552
Buggy source:
/** 
 * Helper function: Display in the log the current entries in the audio focus stack
 */
private void dumpFocusStack(PrintWriter pw){
  pw.println("String_Node_Str");
synchronized (mFocusStack) {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=stackIterator.next();
      pw.println("String_Node_Str" + fse.mSourceRef + "String_Node_Str"+ fse.mClientId+ "String_Node_Str"+ fse.mFocusChangeType);
    }
  }
}

Fixed version (ground truth):
/** 
 * Helper function: Display in the log the current entries in the audio focus stack
 */
private void dumpFocusStack(PrintWriter pw){
  pw.println("String_Node_Str");
synchronized (mAudioFocusLock) {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=stackIterator.next();
      pw.println("String_Node_Str" + fse.mSourceRef + "String_Node_Str"+ fse.mClientId+ "String_Node_Str"+ fse.mFocusChangeType);
    }
  }
}
Program: 41555
Project: 41555
Buggy source:
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}

Fixed version (ground truth):
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  unregisterAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}
Program: 41556
Project: 41556
Buggy source:
/** 
 * Register a listener for audio focus updates.
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}
Program: 41557
Project: 41557
Buggy source:
/** 
 * TODO document for SDK
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
  IAudioService service=getService();
  try {
    service.unregisterAudioFocusClient(getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}
Program: 41558
Project: 41558
Buggy source:
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
synchronized (mFocusStack) {
    removeFocusStackEntry(clientId,true);
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  try {
synchronized (mAudioFocusLock) {
      removeFocusStackEntry(clientId,true);
    }
  }
 catch (  java.util.ConcurrentModificationException cme) {
    Log.e(TAG,"String_Node_Str" + cme);
    cme.printStackTrace();
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 41559
Project: 41559
Buggy source:
public void binderDied(){
synchronized (mFocusStack) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}

Fixed version (ground truth):
public void binderDied(){
synchronized (mAudioFocusLock) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}