nus-yam/ex-repair huggingface dataset:
Program: 22077
Project: 22077
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: 22078
Project: 22078
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (!Intent.ACTION_MEDIA_BUTTON.equals(action)) {
    return;
  }
  KeyEvent event=(KeyEvent)intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
  if (event != null) {
    if ((getMode() == AudioSystem.MODE_IN_CALL) || (getMode() == AudioSystem.MODE_RINGTONE)) {
      return;
    }
synchronized (mRCStack) {
      if (!mRCStack.empty()) {
        Intent targetedIntent=new Intent(Intent.ACTION_MEDIA_BUTTON);
        targetedIntent.putExtras(intent.getExtras());
        targetedIntent.setComponent(mRCStack.peek().mReceiverComponent);
        abortBroadcast();
        context.sendBroadcast(targetedIntent,null);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (!Intent.ACTION_MEDIA_BUTTON.equals(action)) {
    return;
  }
  KeyEvent event=(KeyEvent)intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
  if (event != null) {
synchronized (mRingingLock) {
      if (mIsRinging || (getMode() == AudioSystem.MODE_IN_CALL) || (getMode() == AudioSystem.MODE_RINGTONE)) {
        return;
      }
    }
synchronized (mRCStack) {
      if (!mRCStack.empty()) {
        Intent targetedIntent=new Intent(Intent.ACTION_MEDIA_BUTTON);
        targetedIntent.putExtras(intent.getExtras());
        targetedIntent.setComponent(mRCStack.peek().mReceiverComponent);
        abortBroadcast();
        context.sendBroadcast(targetedIntent,null);
      }
    }
  }
}
Program: 22079
Project: 22079
Buggy source:
@Override public void onCallStateChanged(int state,String incomingNumber){
  if (state == TelephonyManager.CALL_STATE_RINGING) {
    int ringVolume=AudioService.this.getStreamVolume(AudioManager.STREAM_RING);
    if (ringVolume > 0) {
      requestAudioFocus(AudioManager.STREAM_RING,AudioManager.AUDIOFOCUS_GAIN_TRANSIENT,null,null,IN_VOICE_COMM_FOCUS_ID);
    }
  }
 else   if (state == TelephonyManager.CALL_STATE_OFFHOOK) {
    requestAudioFocus(AudioManager.STREAM_RING,AudioManager.AUDIOFOCUS_GAIN_TRANSIENT,null,null,IN_VOICE_COMM_FOCUS_ID);
  }
 else   if (state == TelephonyManager.CALL_STATE_IDLE) {
    abandonAudioFocus(null,IN_VOICE_COMM_FOCUS_ID);
  }
}

Fixed version (ground truth):
@Override public void onCallStateChanged(int state,String incomingNumber){
  if (state == TelephonyManager.CALL_STATE_RINGING) {
synchronized (mRingingLock) {
      mIsRinging=true;
    }
    int ringVolume=AudioService.this.getStreamVolume(AudioManager.STREAM_RING);
    if (ringVolume > 0) {
      requestAudioFocus(AudioManager.STREAM_RING,AudioManager.AUDIOFOCUS_GAIN_TRANSIENT,null,null,IN_VOICE_COMM_FOCUS_ID);
    }
  }
 else   if (state == TelephonyManager.CALL_STATE_OFFHOOK) {
synchronized (mRingingLock) {
      mIsRinging=false;
    }
    requestAudioFocus(AudioManager.STREAM_RING,AudioManager.AUDIOFOCUS_GAIN_TRANSIENT,null,null,IN_VOICE_COMM_FOCUS_ID);
  }
 else   if (state == TelephonyManager.CALL_STATE_IDLE) {
synchronized (mRingingLock) {
      mIsRinging=false;
    }
    abandonAudioFocus(null,IN_VOICE_COMM_FOCUS_ID);
  }
}
Program: 22080
Project: 22080
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: 22081
Project: 22081
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: 22082
Project: 22082
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: 22083
Project: 22083
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: 22084
Project: 22084
Buggy source:
public FinishedCallback(long finishedToken){
  mFinishedToken=finishedToken;
}

Fixed version (ground truth):
private FinishedCallback(){
}
Program: 22086
Project: 22086
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: 22087
Project: 22087
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: 22088
Project: 22088
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: 22089
Project: 22089
Buggy source:
public FinishedCallback(long finishedToken){
  mFinishedToken=finishedToken;
}

Fixed version (ground truth):
private FinishedCallback(){
}
Program: 22093
Project: 22093
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: 22094
Project: 22094
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: 22101
Project: 22101
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: 22102
Project: 22102
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: 22103
Project: 22103
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: 22104
Project: 22104
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: 22105
Project: 22105
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: 22106
Project: 22106
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: 22107
Project: 22107
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: 22108
Project: 22108
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: 22109
Project: 22109
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: 22110
Project: 22110
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: 22111
Project: 22111
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: 22112
Project: 22112
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: 22113
Project: 22113
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: 22114
Project: 22114
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: 22115
Project: 22115
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: 22116
Project: 22116
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: 22117
Project: 22117
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: 22118
Project: 22118
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: 22128
Project: 22128
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: 22129
Project: 22129
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: 22130
Project: 22130
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: 22131
Project: 22131
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: 22132
Project: 22132
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: 22133
Project: 22133
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: 22134
Project: 22134
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: 22135
Project: 22135
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: 22136
Project: 22136
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: 22137
Project: 22137
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: 22138
Project: 22138
Buggy source:
public Boolean geocoderIsImplemented(){
  return mGeocodeProvider != null;
}

Fixed version (ground truth):
public boolean geocoderIsImplemented(){
  return mGeocodeProvider != null;
}
Program: 22139
Project: 22139
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: 22140
Project: 22140
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: 22141
Project: 22141
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: 22142
Project: 22142
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: 22143
Project: 22143
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: 22144
Project: 22144
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());
  }
}