nus-yam/ex-repair huggingface dataset:
Program: 181540
Project: 181540
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: 181541
Project: 181541
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: 181550
Project: 181550
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: 181551
Project: 181551
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: 181552
Project: 181552
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: 181553
Project: 181553
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: 181554
Project: 181554
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: 181555
Project: 181555
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: 181556
Project: 181556
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: 181557
Project: 181557
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: 181558
Project: 181558
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: 181559
Project: 181559
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: 181560
Project: 181560
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: 181561
Project: 181561
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: 181562
Project: 181562
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: 181563
Project: 181563
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: 181564
Project: 181564
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: 181565
Project: 181565
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: 181566
Project: 181566
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: 181567
Project: 181567
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: 181574
Project: 181574
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: 181575
Project: 181575
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: 181579
Project: 181579
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: 181580
Project: 181580
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: 181581
Project: 181581
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: 181582
Project: 181582
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: 181583
Project: 181583
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: 181584
Project: 181584
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: 181585
Project: 181585
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: 181586
Project: 181586
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: 181587
Project: 181587
Buggy source:
public Boolean geocoderIsImplemented(){
  return mGeocodeProvider != null;
}

Fixed version (ground truth):
public boolean geocoderIsImplemented(){
  return mGeocodeProvider != null;
}
Program: 181588
Project: 181588
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: 181589
Project: 181589
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: 181590
Project: 181590
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: 181591
Project: 181591
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: 181592
Project: 181592
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: 181593
Project: 181593
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: 181595
Project: 181595
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: 181596
Project: 181596
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: 181597
Project: 181597
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: 181598
Project: 181598
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: 181599
Project: 181599
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: 181600
Project: 181600
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: 181602
Project: 181602
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: 181604
Project: 181604
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: 181605
Project: 181605
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: 181606
Project: 181606
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: 181607
Project: 181607
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: 181608
Project: 181608
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: 181609
Project: 181609
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: 181611
Project: 181611
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);
    }
  }
}