nus-yam/ex-repair huggingface dataset:
Program: 182437
Project: 182437
Buggy source:
Listener(IBinder token){
  mToken=token;
}

Fixed version (ground truth):
Listener(IBinder token,int uid){
  mToken=token;
  mUid=uid;
}
Program: 182438
Project: 182438
Buggy source:
public boolean enableSensor(IBinder binder,String name,int sensor,int enable) throws RemoteException {
  if (localLOGV)   Slog.d(TAG,"String_Node_Str" + name + "String_Node_Str"+ sensor+ "String_Node_Str"+ enable);
  int uid=Binder.getCallingUid();
  long identity=Binder.clearCallingIdentity();
  if (enable == SENSOR_DISABLE) {
    mBatteryStats.noteStopSensor(uid,sensor);
  }
 else {
    mBatteryStats.noteStartSensor(uid,sensor);
  }
  Binder.restoreCallingIdentity(identity);
  if (binder == null) {
    Slog.w(TAG,"String_Node_Str" + name + "String_Node_Str"+ sensor+ "String_Node_Str");
    return false;
  }
synchronized (mListeners) {
    if (enable != SENSOR_DISABLE && !_sensors_control_activate(sensor,true)) {
      Slog.w(TAG,"String_Node_Str" + sensor);
      return false;
    }
    Listener l=null;
    int minDelay=enable;
    for (    Listener listener : mListeners) {
      if (binder == listener.mToken) {
        l=listener;
      }
      if (minDelay > listener.mDelay)       minDelay=listener.mDelay;
    }
    if (l == null && enable != SENSOR_DISABLE) {
      l=new Listener(binder);
      binder.linkToDeath(l,0);
      mListeners.add(l);
      mListeners.notify();
    }
    if (l == null) {
      Slog.w(TAG,"String_Node_Str" + binder + "String_Node_Str"+ name+ "String_Node_Str"+ sensor+ "String_Node_Str");
      return false;
    }
    if (minDelay >= 0) {
      _sensors_control_set_delay(minDelay);
    }
    if (enable != SENSOR_DISABLE) {
      l.addSensor(sensor,enable);
    }
 else {
      l.removeSensor(sensor);
      deactivateIfUnusedLocked(sensor);
      if (l.mSensors == 0) {
        mListeners.remove(l);
        binder.unlinkToDeath(l,0);
        mListeners.notify();
      }
    }
    if (mListeners.size() == 0) {
      _sensors_control_wake();
      _sensors_control_close();
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean enableSensor(IBinder binder,String name,int sensor,int enable) throws RemoteException {
  if (localLOGV)   Slog.d(TAG,"String_Node_Str" + name + "String_Node_Str"+ sensor+ "String_Node_Str"+ enable);
  if (binder == null) {
    Slog.e(TAG,"String_Node_Str" + name + "String_Node_Str"+ sensor+ "String_Node_Str");
    return false;
  }
  if (enable < 0 && (enable != SENSOR_DISABLE)) {
    Slog.e(TAG,"String_Node_Str" + enable + "String_Node_Str"+ name+ "String_Node_Str"+ sensor+ "String_Node_Str");
    return false;
  }
  boolean res;
  int uid=Binder.getCallingUid();
synchronized (mListeners) {
    res=enableSensorInternalLocked(binder,uid,name,sensor,enable);
    if (res == true) {
      long identity=Binder.clearCallingIdentity();
      if (enable == SENSOR_DISABLE) {
        mBatteryStats.noteStopSensor(uid,sensor);
      }
 else {
        mBatteryStats.noteStartSensor(uid,sensor);
      }
      Binder.restoreCallingIdentity(identity);
    }
  }
  return res;
}
Program: 182439
Project: 182439
Buggy source:
void addSensor(int sensor,int delay){
  mSensors|=(1 << sensor);
  if (mDelay > delay)   mDelay=delay;
}

Fixed version (ground truth):
void addSensor(int sensor,int delay){
  mSensors|=(1 << sensor);
  if (delay < mDelay)   mDelay=delay;
}
Program: 182440
Project: 182440
Buggy source:
private void deactivateIfUnusedLocked(int sensor) throws RemoteException {
  int size=mListeners.size();
  for (int i=0; i < size; i++) {
    if (mListeners.get(i).hasSensor(sensor))     return;
  }
  _sensors_control_activate(sensor,false);
}

Fixed version (ground truth):
private void deactivateIfUnusedLocked(int sensor){
  int size=mListeners.size();
  for (int i=0; i < size; i++) {
    if (mListeners.get(i).hasSensor(sensor)) {
      return;
    }
  }
  if (_sensors_control_activate(sensor,false) == false) {
    Slog.w(TAG,"String_Node_Str" + sensor);
  }
}
Program: 182441
Project: 182441
Buggy source:
public void binderDied(){
  if (localLOGV)   Slog.d(TAG,"String_Node_Str");
synchronized (mListeners) {
    mListeners.remove(this);
    mToken.unlinkToDeath(this,0);
    for (int sensor=0; sensor < 32 && mSensors != 0; sensor++) {
      if (hasSensor(sensor)) {
        removeSensor(sensor);
        try {
          deactivateIfUnusedLocked(sensor);
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str");
        }
      }
    }
    if (mListeners.size() == 0) {
      _sensors_control_wake();
      _sensors_control_close();
    }
    mListeners.notify();
  }
}

Fixed version (ground truth):
public void binderDied(){
  if (localLOGV)   Slog.d(TAG,"String_Node_Str");
synchronized (mListeners) {
    mListeners.remove(this);
    mToken.unlinkToDeath(this,0);
    for (int sensor=0; sensor < 32 && mSensors != 0; sensor++) {
      if (hasSensor(sensor)) {
        removeSensor(sensor);
        deactivateIfUnusedLocked(sensor);
        try {
          mBatteryStats.noteStopSensor(mUid,sensor);
        }
 catch (        RemoteException e) {
        }
      }
    }
    if (mListeners.size() == 0) {
      _sensors_control_wake();
      _sensors_control_close();
    }
 else {
    }
    mListeners.notify();
  }
}
Program: 182446
Project: 182446
Buggy source:
public void onClick(View v){
  if (mSearchable == null) {
    return;
  }
  SearchableInfo searchable=mSearchable;
  cancel();
  try {
    if (searchable.getVoiceSearchLaunchWebSearch()) {
      getContext().startActivity(mVoiceWebSearchIntent);
    }
 else     if (searchable.getVoiceSearchLaunchRecognizer()) {
      Intent appSearchIntent=createVoiceAppSearchIntent(mVoiceAppSearchIntent,searchable);
      getContext().startActivity(appSearchIntent);
    }
  }
 catch (  ActivityNotFoundException e) {
    Log.w(LOG_TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void onClick(View v){
  if (mSearchable == null) {
    return;
  }
  SearchableInfo searchable=mSearchable;
  try {
    if (searchable.getVoiceSearchLaunchWebSearch()) {
      getContext().startActivity(mVoiceWebSearchIntent);
    }
 else     if (searchable.getVoiceSearchLaunchRecognizer()) {
      Intent appSearchIntent=createVoiceAppSearchIntent(mVoiceAppSearchIntent,searchable);
      getContext().startActivity(appSearchIntent);
    }
  }
 catch (  ActivityNotFoundException e) {
    Log.w(LOG_TAG,"String_Node_Str");
  }
  dismiss();
}
Program: 182447
Project: 182447
Buggy source:
/** 
 * The search dialog is being dismissed, so handle all of the local shutdown operations. This function is designed to be idempotent so that dismiss() can be safely called at any time (even if already closed) and more likely to really dump any memory.  No leaks!
 */
@Override public void onStop(){
  super.onStop();
  closeSuggestionsAdapter();
  mLaunchComponent=null;
  mAppSearchData=null;
  mSearchable=null;
  mActivityContext=null;
  mUserQuery=null;
}

Fixed version (ground truth):
/** 
 * The search dialog is being dismissed, so handle all of the local shutdown operations. This function is designed to be idempotent so that dismiss() can be safely called at any time (even if already closed) and more likely to really dump any memory.  No leaks!
 */
@Override public void onStop(){
  super.onStop();
  closeSuggestionsAdapter();
  mLaunchComponent=null;
  mAppSearchData=null;
  mSearchable=null;
  mUserQuery=null;
}
Program: 182448
Project: 182448
Buggy source:
/** 
 * Update the UI according to the info in the current value of   {@link #mSearchable}.
 */
private void updateUI(){
  if (mSearchable != null) {
    mDecor.setVisibility(View.VISIBLE);
    updateSearchAutoComplete();
    updateSearchButton();
    updateSearchAppIcon();
    updateSearchBadge();
    updateQueryHint();
    updateVoiceButton();
    int inputType=mSearchable.getInputType();
    if ((inputType & InputType.TYPE_MASK_CLASS) == InputType.TYPE_CLASS_TEXT) {
      inputType&=~InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE;
      if (mSearchable.getSuggestAuthority() != null) {
        inputType|=InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE;
      }
    }
    mSearchAutoComplete.setInputType(inputType);
    mSearchAutoCompleteImeOptions=mSearchable.getImeOptions();
    mSearchAutoComplete.setImeOptions(mSearchAutoCompleteImeOptions);
    if (mSearchable.getVoiceSearchEnabled()) {
      mSearchAutoComplete.setPrivateImeOptions(IME_OPTION_NO_MICROPHONE);
    }
 else {
      mSearchAutoComplete.setPrivateImeOptions(null);
    }
  }
}

Fixed version (ground truth):
/** 
 * Update the UI according to the info in the current value of   {@link #mSearchable}.
 */
private void updateUI(){
  if (mSearchable != null) {
    mDecor.setVisibility(View.VISIBLE);
    updateSearchAutoComplete();
    updateSearchButton();
    updateSearchAppIcon();
    updateSearchBadge();
    updateQueryHint();
    updateVoiceButton(TextUtils.isEmpty(mUserQuery));
    int inputType=mSearchable.getInputType();
    if ((inputType & InputType.TYPE_MASK_CLASS) == InputType.TYPE_CLASS_TEXT) {
      inputType&=~InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE;
      if (mSearchable.getSuggestAuthority() != null) {
        inputType|=InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE;
      }
    }
    mSearchAutoComplete.setInputType(inputType);
    mSearchAutoCompleteImeOptions=mSearchable.getImeOptions();
    mSearchAutoComplete.setImeOptions(mSearchAutoCompleteImeOptions);
    if (mSearchable.getVoiceSearchEnabled()) {
      mSearchAutoComplete.setPrivateImeOptions(IME_OPTION_NO_MICROPHONE);
    }
 else {
      mSearchAutoComplete.setPrivateImeOptions(null);
    }
  }
}
Program: 182449
Project: 182449
Buggy source:
public void onTextChanged(CharSequence s,int start,int before,int after){
  if (DBG_LOG_TIMING) {
    dbgLogTiming("String_Node_Str");
  }
  if (mSearchable == null) {
    return;
  }
  updateWidgetState();
  if (!mSearchAutoComplete.isPerformingCompletion()) {
    mUserQuery=s == null ? "String_Node_Str" : s.toString();
  }
}

Fixed version (ground truth):
public void onTextChanged(CharSequence s,int start,int before,int after){
  if (DBG_LOG_TIMING) {
    dbgLogTiming("String_Node_Str");
  }
  if (mSearchable == null) {
    return;
  }
  updateWidgetState();
  if (!mSearchAutoComplete.isPerformingCompletion()) {
    mUserQuery=s == null ? "String_Node_Str" : s.toString();
  }
  updateVoiceButton(TextUtils.isEmpty(s));
}
Program: 182450
Project: 182450
Buggy source:
/** 
 * Update the visibility of the voice button.  There are actually two voice search modes,  either of which will activate the button.
 */
private void updateVoiceButton(){
  int visibility=View.GONE;
  if (mSearchable.getVoiceSearchEnabled()) {
    Intent testIntent=null;
    if (mSearchable.getVoiceSearchLaunchWebSearch()) {
      testIntent=mVoiceWebSearchIntent;
    }
 else     if (mSearchable.getVoiceSearchLaunchRecognizer()) {
      testIntent=mVoiceAppSearchIntent;
    }
    if (testIntent != null) {
      ResolveInfo ri=getContext().getPackageManager().resolveActivity(testIntent,PackageManager.MATCH_DEFAULT_ONLY);
      if (ri != null) {
        visibility=View.VISIBLE;
      }
    }
  }
  mVoiceButton.setVisibility(visibility);
}

Fixed version (ground truth):
/** 
 * Update the visibility of the voice button.  There are actually two voice search modes,  either of which will activate the button.
 * @param empty whether the search query text field is empty. If it is, then the othercriteria apply to make the voice button visible. Otherwise the voice button will not be visible - i.e., if the user has typed a query, remove the voice button.
 */
private void updateVoiceButton(boolean empty){
  int visibility=View.GONE;
  if (mSearchable.getVoiceSearchEnabled() && empty) {
    Intent testIntent=null;
    if (mSearchable.getVoiceSearchLaunchWebSearch()) {
      testIntent=mVoiceWebSearchIntent;
    }
 else     if (mSearchable.getVoiceSearchLaunchRecognizer()) {
      testIntent=mVoiceAppSearchIntent;
    }
    if (testIntent != null) {
      ResolveInfo ri=getContext().getPackageManager().resolveActivity(testIntent,PackageManager.MATCH_DEFAULT_ONLY);
      if (ri != null) {
        visibility=View.VISIBLE;
      }
    }
  }
  mVoiceButton.setVisibility(visibility);
}
Program: 182451
Project: 182451
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) {
    return false;
  }
  if (mVelocityTracker == null) {
    mVelocityTracker=VelocityTracker.obtain();
  }
  mVelocityTracker.addMovement(ev);
  final int action=ev.getAction();
  final float y=ev.getY();
switch (action) {
case MotionEvent.ACTION_DOWN:
    if (!mScroller.isFinished()) {
      mScroller.abortAnimation();
    }
  if (!inChild((int)ev.getX(),(int)y)) {
    mIsBeingDragged=false;
    return false;
  }
mLastMotionY=y;
break;
case MotionEvent.ACTION_MOVE:
if (mIsBeingDragged) {
final int deltaY=(int)(mLastMotionY - y);
mLastMotionY=y;
overscrollBy(0,deltaY,0,mScrollY,0,getScrollRange(),0,getOverscrollMax());
break;
}
case MotionEvent.ACTION_UP:
if (mIsBeingDragged) {
final VelocityTracker velocityTracker=mVelocityTracker;
velocityTracker.computeCurrentVelocity(1000,mMaximumVelocity);
int initialVelocity=(int)velocityTracker.getYVelocity();
if (getChildCount() > 0) {
if ((Math.abs(initialVelocity) > mMinimumVelocity)) {
fling(-initialVelocity);
}
 else {
final int bottom=getScrollRange();
if (mScroller.springback(mScrollX,mScrollY,0,0,0,bottom)) {
  invalidate();
}
}
}
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker=null;
}
}
}
return true;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) {
    return false;
  }
  if (mVelocityTracker == null) {
    mVelocityTracker=VelocityTracker.obtain();
  }
  mVelocityTracker.addMovement(ev);
  final int action=ev.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      if (!mScroller.isFinished()) {
        mScroller.abortAnimation();
      }
      final float y=ev.getY();
      if (!(mIsBeingDragged=inChild((int)ev.getX(),(int)y))) {
        return false;
      }
      mLastMotionY=y;
      mActivePointerId=ev.getPointerId(0);
      break;
    }
case MotionEvent.ACTION_MOVE:
  if (mIsBeingDragged) {
    final int activePointerIndex=ev.findPointerIndex(mActivePointerId);
    final float y=ev.getY(activePointerIndex);
    final int deltaY=(int)(mLastMotionY - y);
    mLastMotionY=y;
    overscrollBy(0,deltaY,0,mScrollY,0,getScrollRange(),0,getOverscrollMax());
  }
break;
case MotionEvent.ACTION_UP:
if (mIsBeingDragged) {
final VelocityTracker velocityTracker=mVelocityTracker;
velocityTracker.computeCurrentVelocity(1000,mMaximumVelocity);
int initialVelocity=(int)velocityTracker.getYVelocity(mActivePointerId);
if (getChildCount() > 0) {
  if ((Math.abs(initialVelocity) > mMinimumVelocity)) {
    fling(-initialVelocity);
  }
 else {
    final int bottom=getScrollRange();
    if (mScroller.springback(mScrollX,mScrollY,0,0,0,bottom)) {
      invalidate();
    }
  }
}
mActivePointerId=INVALID_POINTER;
mIsBeingDragged=false;
if (mVelocityTracker != null) {
  mVelocityTracker.recycle();
  mVelocityTracker=null;
}
}
break;
case MotionEvent.ACTION_POINTER_UP:
onSecondaryPointerUp(ev);
break;
}
return true;
}
Program: 182452
Project: 182452
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=ev.getAction();
  if ((action == MotionEvent.ACTION_MOVE) && (mIsBeingDragged)) {
    return true;
  }
  final float y=ev.getY();
switch (action) {
case MotionEvent.ACTION_MOVE:
    final int yDiff=(int)Math.abs(y - mLastMotionY);
  if (yDiff > mTouchSlop) {
    mIsBeingDragged=true;
    mLastMotionY=y;
  }
break;
case MotionEvent.ACTION_DOWN:
if (!inChild((int)ev.getX(),(int)y)) {
mIsBeingDragged=false;
break;
}
mLastMotionY=y;
mIsBeingDragged=!mScroller.isFinished();
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
mIsBeingDragged=false;
break;
}
return mIsBeingDragged;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=ev.getAction();
  if ((action == MotionEvent.ACTION_MOVE) && (mIsBeingDragged)) {
    return true;
  }
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_MOVE:
{
      final int pointerIndex=ev.findPointerIndex(mActivePointerId);
      final float y=ev.getY(pointerIndex);
      final int yDiff=(int)Math.abs(y - mLastMotionY);
      if (yDiff > mTouchSlop) {
        mIsBeingDragged=true;
        mLastMotionY=y;
      }
      break;
    }
case MotionEvent.ACTION_DOWN:
{
    final float y=ev.getY();
    if (!inChild((int)ev.getX(),(int)y)) {
      mIsBeingDragged=false;
      break;
    }
    mLastMotionY=y;
    mActivePointerId=ev.getPointerId(0);
    mIsBeingDragged=!mScroller.isFinished();
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
mIsBeingDragged=false;
mActivePointerId=INVALID_POINTER;
break;
case MotionEvent.ACTION_POINTER_UP:
onSecondaryPointerUp(ev);
break;
}
return mIsBeingDragged;
}
Program: 182453
Project: 182453
Buggy source:
public void onClick(View v){
  if (mSearchable == null) {
    return;
  }
  SearchableInfo searchable=mSearchable;
  cancel();
  try {
    if (searchable.getVoiceSearchLaunchWebSearch()) {
      getContext().startActivity(mVoiceWebSearchIntent);
    }
 else     if (searchable.getVoiceSearchLaunchRecognizer()) {
      Intent appSearchIntent=createVoiceAppSearchIntent(mVoiceAppSearchIntent,searchable);
      getContext().startActivity(appSearchIntent);
    }
  }
 catch (  ActivityNotFoundException e) {
    Log.w(LOG_TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void onClick(View v){
  if (mSearchable == null) {
    return;
  }
  SearchableInfo searchable=mSearchable;
  try {
    if (searchable.getVoiceSearchLaunchWebSearch()) {
      getContext().startActivity(mVoiceWebSearchIntent);
    }
 else     if (searchable.getVoiceSearchLaunchRecognizer()) {
      Intent appSearchIntent=createVoiceAppSearchIntent(mVoiceAppSearchIntent,searchable);
      getContext().startActivity(appSearchIntent);
    }
  }
 catch (  ActivityNotFoundException e) {
    Log.w(LOG_TAG,"String_Node_Str");
  }
  dismiss();
}
Program: 182454
Project: 182454
Buggy source:
/** 
 * The search dialog is being dismissed, so handle all of the local shutdown operations. This function is designed to be idempotent so that dismiss() can be safely called at any time (even if already closed) and more likely to really dump any memory.  No leaks!
 */
@Override public void onStop(){
  super.onStop();
  closeSuggestionsAdapter();
  mLaunchComponent=null;
  mAppSearchData=null;
  mSearchable=null;
  mActivityContext=null;
  mUserQuery=null;
}

Fixed version (ground truth):
/** 
 * The search dialog is being dismissed, so handle all of the local shutdown operations. This function is designed to be idempotent so that dismiss() can be safely called at any time (even if already closed) and more likely to really dump any memory.  No leaks!
 */
@Override public void onStop(){
  super.onStop();
  closeSuggestionsAdapter();
  mLaunchComponent=null;
  mAppSearchData=null;
  mSearchable=null;
  mUserQuery=null;
}
Program: 182455
Project: 182455
Buggy source:
/** 
 * Update the UI according to the info in the current value of   {@link #mSearchable}.
 */
private void updateUI(){
  if (mSearchable != null) {
    mDecor.setVisibility(View.VISIBLE);
    updateSearchAutoComplete();
    updateSearchButton();
    updateSearchAppIcon();
    updateSearchBadge();
    updateQueryHint();
    updateVoiceButton();
    int inputType=mSearchable.getInputType();
    if ((inputType & InputType.TYPE_MASK_CLASS) == InputType.TYPE_CLASS_TEXT) {
      inputType&=~InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE;
      if (mSearchable.getSuggestAuthority() != null) {
        inputType|=InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE;
      }
    }
    mSearchAutoComplete.setInputType(inputType);
    mSearchAutoCompleteImeOptions=mSearchable.getImeOptions();
    mSearchAutoComplete.setImeOptions(mSearchAutoCompleteImeOptions);
    if (mSearchable.getVoiceSearchEnabled()) {
      mSearchAutoComplete.setPrivateImeOptions(IME_OPTION_NO_MICROPHONE);
    }
 else {
      mSearchAutoComplete.setPrivateImeOptions(null);
    }
  }
}

Fixed version (ground truth):
/** 
 * Update the UI according to the info in the current value of   {@link #mSearchable}.
 */
private void updateUI(){
  if (mSearchable != null) {
    mDecor.setVisibility(View.VISIBLE);
    updateSearchAutoComplete();
    updateSearchButton();
    updateSearchAppIcon();
    updateSearchBadge();
    updateQueryHint();
    updateVoiceButton(TextUtils.isEmpty(mUserQuery));
    int inputType=mSearchable.getInputType();
    if ((inputType & InputType.TYPE_MASK_CLASS) == InputType.TYPE_CLASS_TEXT) {
      inputType&=~InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE;
      if (mSearchable.getSuggestAuthority() != null) {
        inputType|=InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE;
      }
    }
    mSearchAutoComplete.setInputType(inputType);
    mSearchAutoCompleteImeOptions=mSearchable.getImeOptions();
    mSearchAutoComplete.setImeOptions(mSearchAutoCompleteImeOptions);
    if (mSearchable.getVoiceSearchEnabled()) {
      mSearchAutoComplete.setPrivateImeOptions(IME_OPTION_NO_MICROPHONE);
    }
 else {
      mSearchAutoComplete.setPrivateImeOptions(null);
    }
  }
}
Program: 182456
Project: 182456
Buggy source:
public void onTextChanged(CharSequence s,int start,int before,int after){
  if (DBG_LOG_TIMING) {
    dbgLogTiming("String_Node_Str");
  }
  if (mSearchable == null) {
    return;
  }
  updateWidgetState();
  if (!mSearchAutoComplete.isPerformingCompletion()) {
    mUserQuery=s == null ? "String_Node_Str" : s.toString();
  }
}

Fixed version (ground truth):
public void onTextChanged(CharSequence s,int start,int before,int after){
  if (DBG_LOG_TIMING) {
    dbgLogTiming("String_Node_Str");
  }
  if (mSearchable == null) {
    return;
  }
  updateWidgetState();
  if (!mSearchAutoComplete.isPerformingCompletion()) {
    mUserQuery=s == null ? "String_Node_Str" : s.toString();
  }
  updateVoiceButton(TextUtils.isEmpty(s));
}
Program: 182457
Project: 182457
Buggy source:
/** 
 * Update the visibility of the voice button.  There are actually two voice search modes,  either of which will activate the button.
 */
private void updateVoiceButton(){
  int visibility=View.GONE;
  if (mSearchable.getVoiceSearchEnabled()) {
    Intent testIntent=null;
    if (mSearchable.getVoiceSearchLaunchWebSearch()) {
      testIntent=mVoiceWebSearchIntent;
    }
 else     if (mSearchable.getVoiceSearchLaunchRecognizer()) {
      testIntent=mVoiceAppSearchIntent;
    }
    if (testIntent != null) {
      ResolveInfo ri=getContext().getPackageManager().resolveActivity(testIntent,PackageManager.MATCH_DEFAULT_ONLY);
      if (ri != null) {
        visibility=View.VISIBLE;
      }
    }
  }
  mVoiceButton.setVisibility(visibility);
}

Fixed version (ground truth):
/** 
 * Update the visibility of the voice button.  There are actually two voice search modes,  either of which will activate the button.
 * @param empty whether the search query text field is empty. If it is, then the othercriteria apply to make the voice button visible. Otherwise the voice button will not be visible - i.e., if the user has typed a query, remove the voice button.
 */
private void updateVoiceButton(boolean empty){
  int visibility=View.GONE;
  if (mSearchable.getVoiceSearchEnabled() && empty) {
    Intent testIntent=null;
    if (mSearchable.getVoiceSearchLaunchWebSearch()) {
      testIntent=mVoiceWebSearchIntent;
    }
 else     if (mSearchable.getVoiceSearchLaunchRecognizer()) {
      testIntent=mVoiceAppSearchIntent;
    }
    if (testIntent != null) {
      ResolveInfo ri=getContext().getPackageManager().resolveActivity(testIntent,PackageManager.MATCH_DEFAULT_ONLY);
      if (ri != null) {
        visibility=View.VISIBLE;
      }
    }
  }
  mVoiceButton.setVisibility(visibility);
}
Program: 182458
Project: 182458
Buggy source:
SQLiteProgram(SQLiteDatabase db,String sql){
  mDatabase=db;
  mSql=sql;
  db.acquireReference();
  db.addSQLiteClosable(this);
  this.nHandle=db.mNativeHandle;
  mCompiledSql=db.getCompiledStatementForSql(sql);
  if (mCompiledSql == null) {
    mCompiledSql=new SQLiteCompiledSql(db,sql);
    db.addToCompiledQueries(sql,mCompiledSql);
    mCompiledSql.acquire();
  }
 else {
    if (!mCompiledSql.acquire()) {
      mCompiledSql=new SQLiteCompiledSql(db,sql);
    }
  }
  nStatement=mCompiledSql.nStatement;
}

Fixed version (ground truth):
SQLiteProgram(SQLiteDatabase db,String sql){
  mDatabase=db;
  mSql=sql;
  db.acquireReference();
  db.addSQLiteClosable(this);
  this.nHandle=db.mNativeHandle;
  mCompiledSql=db.getCompiledStatementForSql(sql);
  if (mCompiledSql == null) {
    mCompiledSql=new SQLiteCompiledSql(db,sql);
    mCompiledSql.acquire();
    db.addToCompiledQueries(sql,mCompiledSql);
  }
 else {
    if (!mCompiledSql.acquire()) {
      mCompiledSql=new SQLiteCompiledSql(db,sql);
    }
  }
  nStatement=mCompiledSql.nStatement;
}
Program: 182459
Project: 182459
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) {
    return false;
  }
  if (mVelocityTracker == null) {
    mVelocityTracker=VelocityTracker.obtain();
  }
  mVelocityTracker.addMovement(ev);
  final int action=ev.getAction();
  final float y=ev.getY();
switch (action) {
case MotionEvent.ACTION_DOWN:
    if (!mScroller.isFinished()) {
      mScroller.abortAnimation();
    }
  if (!inChild((int)ev.getX(),(int)y)) {
    mIsBeingDragged=false;
    return false;
  }
mLastMotionY=y;
break;
case MotionEvent.ACTION_MOVE:
if (mIsBeingDragged) {
final int deltaY=(int)(mLastMotionY - y);
mLastMotionY=y;
overscrollBy(0,deltaY,0,mScrollY,0,getScrollRange(),0,getOverscrollMax());
break;
}
case MotionEvent.ACTION_UP:
if (mIsBeingDragged) {
final VelocityTracker velocityTracker=mVelocityTracker;
velocityTracker.computeCurrentVelocity(1000,mMaximumVelocity);
int initialVelocity=(int)velocityTracker.getYVelocity();
if (getChildCount() > 0) {
if ((Math.abs(initialVelocity) > mMinimumVelocity)) {
fling(-initialVelocity);
}
 else {
final int bottom=getScrollRange();
if (mScroller.springback(mScrollX,mScrollY,0,0,0,bottom)) {
  invalidate();
}
}
}
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker=null;
}
}
}
return true;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) {
    return false;
  }
  if (mVelocityTracker == null) {
    mVelocityTracker=VelocityTracker.obtain();
  }
  mVelocityTracker.addMovement(ev);
  final int action=ev.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      if (!mScroller.isFinished()) {
        mScroller.abortAnimation();
      }
      final float y=ev.getY();
      if (!(mIsBeingDragged=inChild((int)ev.getX(),(int)y))) {
        return false;
      }
      mLastMotionY=y;
      mActivePointerId=ev.getPointerId(0);
      break;
    }
case MotionEvent.ACTION_MOVE:
  if (mIsBeingDragged) {
    final int activePointerIndex=ev.findPointerIndex(mActivePointerId);
    final float y=ev.getY(activePointerIndex);
    final int deltaY=(int)(mLastMotionY - y);
    mLastMotionY=y;
    overscrollBy(0,deltaY,0,mScrollY,0,getScrollRange(),0,getOverscrollMax());
  }
break;
case MotionEvent.ACTION_UP:
if (mIsBeingDragged) {
final VelocityTracker velocityTracker=mVelocityTracker;
velocityTracker.computeCurrentVelocity(1000,mMaximumVelocity);
int initialVelocity=(int)velocityTracker.getYVelocity(mActivePointerId);
if (getChildCount() > 0) {
  if ((Math.abs(initialVelocity) > mMinimumVelocity)) {
    fling(-initialVelocity);
  }
 else {
    final int bottom=getScrollRange();
    if (mScroller.springback(mScrollX,mScrollY,0,0,0,bottom)) {
      invalidate();
    }
  }
}
mActivePointerId=INVALID_POINTER;
mIsBeingDragged=false;
if (mVelocityTracker != null) {
  mVelocityTracker.recycle();
  mVelocityTracker=null;
}
}
break;
case MotionEvent.ACTION_POINTER_UP:
onSecondaryPointerUp(ev);
break;
}
return true;
}
Program: 182460
Project: 182460
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=ev.getAction();
  if ((action == MotionEvent.ACTION_MOVE) && (mIsBeingDragged)) {
    return true;
  }
  final float y=ev.getY();
switch (action) {
case MotionEvent.ACTION_MOVE:
    final int yDiff=(int)Math.abs(y - mLastMotionY);
  if (yDiff > mTouchSlop) {
    mIsBeingDragged=true;
    mLastMotionY=y;
  }
break;
case MotionEvent.ACTION_DOWN:
if (!inChild((int)ev.getX(),(int)y)) {
mIsBeingDragged=false;
break;
}
mLastMotionY=y;
mIsBeingDragged=!mScroller.isFinished();
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
mIsBeingDragged=false;
break;
}
return mIsBeingDragged;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=ev.getAction();
  if ((action == MotionEvent.ACTION_MOVE) && (mIsBeingDragged)) {
    return true;
  }
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_MOVE:
{
      final int pointerIndex=ev.findPointerIndex(mActivePointerId);
      final float y=ev.getY(pointerIndex);
      final int yDiff=(int)Math.abs(y - mLastMotionY);
      if (yDiff > mTouchSlop) {
        mIsBeingDragged=true;
        mLastMotionY=y;
      }
      break;
    }
case MotionEvent.ACTION_DOWN:
{
    final float y=ev.getY();
    if (!inChild((int)ev.getX(),(int)y)) {
      mIsBeingDragged=false;
      break;
    }
    mLastMotionY=y;
    mActivePointerId=ev.getPointerId(0);
    mIsBeingDragged=!mScroller.isFinished();
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
mIsBeingDragged=false;
mActivePointerId=INVALID_POINTER;
break;
case MotionEvent.ACTION_POINTER_UP:
onSecondaryPointerUp(ev);
break;
}
return mIsBeingDragged;
}
Program: 182461
Project: 182461
Buggy source:
final void releaseTheme(int theme){
synchronized (this) {
    deleteTheme(theme);
    decRefsLocked();
  }
}

Fixed version (ground truth):
final void releaseTheme(int theme){
synchronized (this) {
    deleteTheme(theme);
    decRefsLocked(theme);
  }
}
Program: 182462
Project: 182462
Buggy source:
private final void decRefsLocked(){
  mNumRefs--;
  if (mNumRefs == 0) {
    destroy();
  }
}

Fixed version (ground truth):
private final void decRefsLocked(int id){
  if (DEBUG_REFS && mRefStacks != null) {
    mRefStacks.remove(id);
  }
  mNumRefs--;
  if (mNumRefs == 0) {
    destroy();
  }
}
Program: 182463
Project: 182463
Buggy source:
final int createTheme(){
synchronized (this) {
    if (!mOpen) {
      throw new RuntimeException("String_Node_Str");
    }
    mNumRefs++;
    return newTheme();
  }
}

Fixed version (ground truth):
final int createTheme(){
synchronized (this) {
    if (!mOpen) {
      throw new RuntimeException("String_Node_Str");
    }
    int res=newTheme();
    incRefsLocked(res);
    return res;
  }
}
Program: 182464
Project: 182464
Buggy source:
public final void close() throws IOException {
synchronized (AssetManager.this) {
    if (mAsset != 0) {
      destroyAsset(mAsset);
      mAsset=0;
      decRefsLocked();
    }
  }
}

Fixed version (ground truth):
public final void close() throws IOException {
synchronized (AssetManager.this) {
    if (mAsset != 0) {
      destroyAsset(mAsset);
      mAsset=0;
      decRefsLocked(hashCode());
    }
  }
}
Program: 182465
Project: 182465
Buggy source:
private AssetManager(boolean isSystem){
  init();
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + this);
}

Fixed version (ground truth):
private AssetManager(boolean isSystem){
  if (DEBUG_REFS) {
synchronized (this) {
      mNumRefs=0;
      incRefsLocked(this.hashCode());
    }
  }
  init();
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + this);
}
Program: 182466
Project: 182466
Buggy source:
/** 
 * {@hide}Retrieve a non-asset as a compiled XML file.  Not for use by applications.
 * @param cookie Identifier of the package to be opened.
 * @param fileName Name of the asset to retrieve.
 */
final XmlBlock openXmlBlockAsset(int cookie,String fileName) throws IOException {
synchronized (this) {
    if (!mOpen) {
      throw new RuntimeException("String_Node_Str");
    }
    int xmlBlock=openXmlAssetNative(cookie,fileName);
    if (xmlBlock != 0) {
      mNumRefs++;
      return new XmlBlock(this,xmlBlock);
    }
  }
  throw new FileNotFoundException("String_Node_Str" + fileName);
}

Fixed version (ground truth):
/** 
 * {@hide}Retrieve a non-asset as a compiled XML file.  Not for use by applications.
 * @param cookie Identifier of the package to be opened.
 * @param fileName Name of the asset to retrieve.
 */
final XmlBlock openXmlBlockAsset(int cookie,String fileName) throws IOException {
synchronized (this) {
    if (!mOpen) {
      throw new RuntimeException("String_Node_Str");
    }
    int xmlBlock=openXmlAssetNative(cookie,fileName);
    if (xmlBlock != 0) {
      XmlBlock res=new XmlBlock(this,xmlBlock);
      incRefsLocked(res.hashCode());
      return res;
    }
  }
  throw new FileNotFoundException("String_Node_Str" + fileName);
}
Program: 182467
Project: 182467
Buggy source:
/** 
 * {@hide}Open a non-asset in a specified package.  Not for use by applications.
 * @param cookie Identifier of the package to be opened.
 * @param fileName Name of the asset to retrieve.
 * @param accessMode Desired access mode for retrieving the data.
 */
public final InputStream openNonAsset(int cookie,String fileName,int accessMode) throws IOException {
synchronized (this) {
    if (!mOpen) {
      throw new RuntimeException("String_Node_Str");
    }
    int asset=openNonAssetNative(cookie,fileName,accessMode);
    if (asset != 0) {
      mNumRefs++;
      return new AssetInputStream(asset);
    }
  }
  throw new FileNotFoundException("String_Node_Str" + fileName);
}

Fixed version (ground truth):
/** 
 * {@hide}Open a non-asset in a specified package.  Not for use by applications.
 * @param cookie Identifier of the package to be opened.
 * @param fileName Name of the asset to retrieve.
 * @param accessMode Desired access mode for retrieving the data.
 */
public final InputStream openNonAsset(int cookie,String fileName,int accessMode) throws IOException {
synchronized (this) {
    if (!mOpen) {
      throw new RuntimeException("String_Node_Str");
    }
    int asset=openNonAssetNative(cookie,fileName,accessMode);
    if (asset != 0) {
      AssetInputStream res=new AssetInputStream(asset);
      incRefsLocked(res.hashCode());
      return res;
    }
  }
  throw new FileNotFoundException("String_Node_Str" + fileName);
}
Program: 182468
Project: 182468
Buggy source:
void xmlBlockGone(){
synchronized (this) {
    decRefsLocked();
  }
}

Fixed version (ground truth):
void xmlBlockGone(int id){
synchronized (this) {
    decRefsLocked(id);
  }
}
Program: 182469
Project: 182469
Buggy source:
/** 
 * Open an asset using an explicit access mode, returning an InputStream to read its contents.  This provides access to files that have been bundled with an application as assets -- that is, files placed in to the "assets" directory.
 * @param fileName The name of the asset to open.  This name can behierarchical.
 * @param accessMode Desired access mode for retrieving the data.
 * @see #ACCESS_UNKNOWN
 * @see #ACCESS_STREAMING
 * @see #ACCESS_RANDOM
 * @see #ACCESS_BUFFER
 * @see #open(String)
 * @see #list
 */
public final InputStream open(String fileName,int accessMode) throws IOException {
synchronized (this) {
    if (!mOpen) {
      throw new RuntimeException("String_Node_Str");
    }
    int asset=openAsset(fileName,accessMode);
    if (asset != 0) {
      mNumRefs++;
      return new AssetInputStream(asset);
    }
  }
  throw new FileNotFoundException("String_Node_Str" + fileName);
}

Fixed version (ground truth):
/** 
 * Open an asset using an explicit access mode, returning an InputStream to read its contents.  This provides access to files that have been bundled with an application as assets -- that is, files placed in to the "assets" directory.
 * @param fileName The name of the asset to open.  This name can behierarchical.
 * @param accessMode Desired access mode for retrieving the data.
 * @see #ACCESS_UNKNOWN
 * @see #ACCESS_STREAMING
 * @see #ACCESS_RANDOM
 * @see #ACCESS_BUFFER
 * @see #open(String)
 * @see #list
 */
public final InputStream open(String fileName,int accessMode) throws IOException {
synchronized (this) {
    if (!mOpen) {
      throw new RuntimeException("String_Node_Str");
    }
    int asset=openAsset(fileName,accessMode);
    if (asset != 0) {
      AssetInputStream res=new AssetInputStream(asset);
      incRefsLocked(res.hashCode());
      return res;
    }
  }
  throw new FileNotFoundException("String_Node_Str" + fileName);
}
Program: 182470
Project: 182470
Buggy source:
private void decOpenCountLocked(){
  mOpenCount--;
  if (mOpenCount == 0) {
    nativeDestroy(mNative);
    if (mAssets != null) {
      mAssets.xmlBlockGone();
    }
  }
}

Fixed version (ground truth):
private void decOpenCountLocked(){
  mOpenCount--;
  if (mOpenCount == 0) {
    nativeDestroy(mNative);
    if (mAssets != null) {
      mAssets.xmlBlockGone(hashCode());
    }
  }
}
Program: 182471
Project: 182471
Buggy source:
public static final void installSystemProviders(){
  ProcessRecord app=mSelf.mProcessNames.get("String_Node_Str",Process.SYSTEM_UID);
  List providers=mSelf.generateApplicationProvidersLocked(app);
  mSystemThread.installSystemProviders(providers);
}

Fixed version (ground truth):
public static final void installSystemProviders(){
  ProcessRecord app=mSelf.mProcessNames.get("String_Node_Str",Process.SYSTEM_UID);
  List providers=mSelf.generateApplicationProvidersLocked(app);
  if (providers != null) {
    for (int i=providers.size() - 1; i >= 0; i--) {
      ProviderInfo pi=(ProviderInfo)providers.get(i);
      if ((pi.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
        Log.w(TAG,"String_Node_Str" + pi.name + "String_Node_Str");
        providers.remove(i);
      }
    }
  }
  mSystemThread.installSystemProviders(providers);
}
Program: 182473
Project: 182473
Buggy source:
void dump(PrintWriter pw,String prefix){
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.print(uid);
  pw.print("String_Node_Str");
  pw.print(key.packageName);
  pw.print("String_Node_Str");
  pw.print(key.typeName());
  pw.print("String_Node_Str");
  pw.println(Integer.toHexString(key.flags));
  if (key.activity != null || key.who != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(key.activity);
    pw.print("String_Node_Str");
    pw.println(key.who);
  }
  if (key.requestCode != 0 || key.requestResolvedType != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(key.requestCode);
    pw.print("String_Node_Str");
    pw.println(key.requestResolvedType);
  }
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.println(key.requestIntent.toShortString(true,true));
  if (sent || canceled) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(sent);
    pw.print("String_Node_Str");
    pw.println(canceled);
  }
}

Fixed version (ground truth):
void dump(PrintWriter pw,String prefix){
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.print(uid);
  pw.print("String_Node_Str");
  pw.print(key.packageName);
  pw.print("String_Node_Str");
  pw.print(key.typeName());
  pw.print("String_Node_Str");
  pw.println(Integer.toHexString(key.flags));
  if (key.activity != null || key.who != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(key.activity);
    pw.print("String_Node_Str");
    pw.println(key.who);
  }
  if (key.requestCode != 0 || key.requestResolvedType != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(key.requestCode);
    pw.print("String_Node_Str");
    pw.println(key.requestResolvedType);
  }
  if (key.requestIntent != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.println(key.requestIntent.toShortString(true,true));
  }
  if (sent || canceled) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(sent);
    pw.print("String_Node_Str");
    pw.println(canceled);
  }
}
Program: 182474
Project: 182474
Buggy source:
SQLiteProgram(SQLiteDatabase db,String sql){
  mDatabase=db;
  mSql=sql;
  db.acquireReference();
  db.addSQLiteClosable(this);
  this.nHandle=db.mNativeHandle;
  mCompiledSql=db.getCompiledStatementForSql(sql);
  if (mCompiledSql == null) {
    mCompiledSql=new SQLiteCompiledSql(db,sql);
    db.addToCompiledQueries(sql,mCompiledSql);
    mCompiledSql.acquire();
  }
 else {
    if (!mCompiledSql.acquire()) {
      mCompiledSql=new SQLiteCompiledSql(db,sql);
    }
  }
  nStatement=mCompiledSql.nStatement;
}

Fixed version (ground truth):
SQLiteProgram(SQLiteDatabase db,String sql){
  mDatabase=db;
  mSql=sql;
  db.acquireReference();
  db.addSQLiteClosable(this);
  this.nHandle=db.mNativeHandle;
  mCompiledSql=db.getCompiledStatementForSql(sql);
  if (mCompiledSql == null) {
    mCompiledSql=new SQLiteCompiledSql(db,sql);
    mCompiledSql.acquire();
    db.addToCompiledQueries(sql,mCompiledSql);
  }
 else {
    if (!mCompiledSql.acquire()) {
      mCompiledSql=new SQLiteCompiledSql(db,sql);
    }
  }
  nStatement=mCompiledSql.nStatement;
}
Program: 182475
Project: 182475
Buggy source:
public int renameSecureContainer(String oldId,String newId){
  validatePermission(android.Manifest.permission.ASEC_RENAME);
  waitForReady();
  warnOnNotMounted();
synchronized (mAsecMountSet) {
    if (mAsecMountSet.contains(oldId)) {
      return StorageResultCode.OperationFailedStorageMounted;
    }
  }
  int rc=StorageResultCode.OperationSucceeded;
  String cmd=String.format("String_Node_Str",oldId,newId);
  try {
    mConnector.doCommand(cmd);
  }
 catch (  NativeDaemonConnectorException e) {
    rc=StorageResultCode.OperationFailedInternalError;
  }
  return rc;
}

Fixed version (ground truth):
public int renameSecureContainer(String oldId,String newId){
  validatePermission(android.Manifest.permission.ASEC_RENAME);
  waitForReady();
  warnOnNotMounted();
synchronized (mAsecMountSet) {
    if (mAsecMountSet.contains(oldId) || mAsecMountSet.contains(newId)) {
      return StorageResultCode.OperationFailedStorageMounted;
    }
  }
  int rc=StorageResultCode.OperationSucceeded;
  String cmd=String.format("String_Node_Str",oldId,newId);
  try {
    mConnector.doCommand(cmd);
  }
 catch (  NativeDaemonConnectorException e) {
    rc=StorageResultCode.OperationFailedInternalError;
  }
  return rc;
}
Program: 182476
Project: 182476
Buggy source:
private static void addPropertiesForRuleStr(ICalendar.Component component,String propertyName,String ruleStr){
  if (TextUtils.isEmpty(ruleStr)) {
    return;
  }
  String[] rrules=ruleStr.split(RULE_SEPARATOR);
  for (  String rrule : rrules) {
    ICalendar.Property prop=new ICalendar.Property(propertyName);
    prop.setValue(rrule);
    component.addProperty(prop);
  }
}

Fixed version (ground truth):
private static void addPropertiesForRuleStr(ICalendar.Component component,String propertyName,String ruleStr){
  if (TextUtils.isEmpty(ruleStr)) {
    return;
  }
  String[] rrules=getRuleStrings(ruleStr);
  for (  String rrule : rrules) {
    ICalendar.Property prop=new ICalendar.Property(propertyName);
    prop.setValue(rrule);
    component.addProperty(prop);
  }
}
Program: 182478
Project: 182478
Buggy source:
private static void addPropertiesForRuleStr(ICalendar.Component component,String propertyName,String ruleStr){
  if (TextUtils.isEmpty(ruleStr)) {
    return;
  }
  String[] rrules=ruleStr.split(RULE_SEPARATOR);
  for (  String rrule : rrules) {
    ICalendar.Property prop=new ICalendar.Property(propertyName);
    prop.setValue(rrule);
    component.addProperty(prop);
  }
}

Fixed version (ground truth):
private static void addPropertiesForRuleStr(ICalendar.Component component,String propertyName,String ruleStr){
  if (TextUtils.isEmpty(ruleStr)) {
    return;
  }
  String[] rrules=getRuleStrings(ruleStr);
  for (  String rrule : rrules) {
    ICalendar.Property prop=new ICalendar.Property(propertyName);
    prop.setValue(rrule);
    component.addProperty(prop);
  }
}
Program: 182480
Project: 182480
Buggy source:
public int renameSecureContainer(String oldId,String newId){
  validatePermission(android.Manifest.permission.ASEC_RENAME);
  waitForReady();
  warnOnNotMounted();
synchronized (mAsecMountSet) {
    if (mAsecMountSet.contains(oldId)) {
      return StorageResultCode.OperationFailedStorageMounted;
    }
  }
  int rc=StorageResultCode.OperationSucceeded;
  String cmd=String.format("String_Node_Str",oldId,newId);
  try {
    mConnector.doCommand(cmd);
  }
 catch (  NativeDaemonConnectorException e) {
    rc=StorageResultCode.OperationFailedInternalError;
  }
  return rc;
}

Fixed version (ground truth):
public int renameSecureContainer(String oldId,String newId){
  validatePermission(android.Manifest.permission.ASEC_RENAME);
  waitForReady();
  warnOnNotMounted();
synchronized (mAsecMountSet) {
    if (mAsecMountSet.contains(oldId) || mAsecMountSet.contains(newId)) {
      return StorageResultCode.OperationFailedStorageMounted;
    }
  }
  int rc=StorageResultCode.OperationSucceeded;
  String cmd=String.format("String_Node_Str",oldId,newId);
  try {
    mConnector.doCommand(cmd);
  }
 catch (  NativeDaemonConnectorException e) {
    rc=StorageResultCode.OperationFailedInternalError;
  }
  return rc;
}
Program: 182481
Project: 182481
Buggy source:
private final void handleLaunchActivity(ActivityRecord r,Intent customIntent){
  unscheduleGcIdler();
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + r);
  Activity a=performLaunchActivity(r,customIntent);
  if (a != null) {
    r.createdConfig=new Configuration(mConfiguration);
    handleResumeActivity(r.token,false,r.isForward);
    if (!r.activity.mFinished && r.startsNotResumed) {
      try {
        r.activity.mCalled=false;
        mInstrumentation.callActivityOnPause(r.activity);
        if (!r.activity.mCalled) {
          throw new SuperNotCalledException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str");
        }
      }
 catch (      SuperNotCalledException e) {
        throw e;
      }
catch (      Exception e) {
        if (!mInstrumentation.onException(r.activity,e)) {
          throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
        }
      }
      r.paused=true;
    }
  }
 else {
    try {
      ActivityManagerNative.getDefault().finishActivity(r.token,Activity.RESULT_CANCELED,null);
    }
 catch (    RemoteException ex) {
    }
  }
}

Fixed version (ground truth):
private final void handleLaunchActivity(ActivityRecord r,Intent customIntent){
  unscheduleGcIdler();
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + r);
  Activity a=performLaunchActivity(r,customIntent);
  if (a != null) {
    r.createdConfig=new Configuration(mConfiguration);
    Bundle oldState=r.state;
    handleResumeActivity(r.token,false,r.isForward);
    if (!r.activity.mFinished && r.startsNotResumed) {
      try {
        r.activity.mCalled=false;
        mInstrumentation.callActivityOnPause(r.activity);
        r.state=oldState;
        if (!r.activity.mCalled) {
          throw new SuperNotCalledException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str");
        }
      }
 catch (      SuperNotCalledException e) {
        throw e;
      }
catch (      Exception e) {
        if (!mInstrumentation.onException(r.activity,e)) {
          throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
        }
      }
      r.paused=true;
    }
  }
 else {
    try {
      ActivityManagerNative.getDefault().finishActivity(r.token,Activity.RESULT_CANCELED,null);
    }
 catch (    RemoteException ex) {
    }
  }
}