nus-yam/ex-repair huggingface dataset:
Program: 42381
Project: 42381
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: 42382
Project: 42382
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: 42385
Project: 42385
Buggy source:
private int setEngine(String enginePackageName){
  String soFilename="String_Node_Str";
  if (enginePackageName.equals("String_Node_Str")) {
    soFilename="String_Node_Str";
  }
 else {
    Intent intent=new Intent("String_Node_Str");
    intent.setPackage(enginePackageName);
    ResolveInfo[] enginesArray=new ResolveInfo[0];
    PackageManager pm=getPackageManager();
    List<ResolveInfo> resolveInfos=pm.queryIntentActivities(intent,0);
    if ((resolveInfos == null) || resolveInfos.isEmpty()) {
      Log.e(SERVICE_TAG,"String_Node_Str" + enginePackageName);
      return TextToSpeech.ERROR;
    }
    enginesArray=resolveInfos.toArray(enginesArray);
    ActivityInfo aInfo=enginesArray[0].activityInfo;
    soFilename=aInfo.name.replace(aInfo.packageName + "String_Node_Str","String_Node_Str") + "String_Node_Str";
    soFilename=soFilename.toLowerCase();
    soFilename="String_Node_Str" + aInfo.packageName + "String_Node_Str"+ soFilename;
  }
  if (currentSpeechEngineSOFile.equals(soFilename)) {
    return TextToSpeech.SUCCESS;
  }
  File f=new File(soFilename);
  if (!f.exists()) {
    Log.e(SERVICE_TAG,"String_Node_Str" + soFilename);
    return TextToSpeech.ERROR;
  }
  if (sNativeSynth != null) {
    sNativeSynth.stopSync();
    sNativeSynth.shutdown();
    sNativeSynth=null;
  }
  sNativeSynth=new SynthProxy(soFilename);
  currentSpeechEngineSOFile=soFilename;
  return TextToSpeech.SUCCESS;
}

Fixed version (ground truth):
private int setEngine(String enginePackageName){
  String soFilename="String_Node_Str";
  if (isDefaultEnforced()) {
    enginePackageName=getDefaultEngine();
  }
  if (enginePackageName.equals("String_Node_Str")) {
    soFilename="String_Node_Str";
  }
 else {
    Intent intent=new Intent("String_Node_Str");
    intent.setPackage(enginePackageName);
    ResolveInfo[] enginesArray=new ResolveInfo[0];
    PackageManager pm=getPackageManager();
    List<ResolveInfo> resolveInfos=pm.queryIntentActivities(intent,0);
    if ((resolveInfos == null) || resolveInfos.isEmpty()) {
      Log.e(SERVICE_TAG,"String_Node_Str" + enginePackageName);
      return TextToSpeech.ERROR;
    }
    enginesArray=resolveInfos.toArray(enginesArray);
    ActivityInfo aInfo=enginesArray[0].activityInfo;
    soFilename=aInfo.name.replace(aInfo.packageName + "String_Node_Str","String_Node_Str") + "String_Node_Str";
    soFilename=soFilename.toLowerCase();
    soFilename="String_Node_Str" + aInfo.packageName + "String_Node_Str"+ soFilename;
  }
  if (currentSpeechEngineSOFile.equals(soFilename)) {
    return TextToSpeech.SUCCESS;
  }
  File f=new File(soFilename);
  if (!f.exists()) {
    Log.e(SERVICE_TAG,"String_Node_Str" + soFilename);
    return TextToSpeech.ERROR;
  }
  if (sNativeSynth != null) {
    sNativeSynth.stopSync();
    sNativeSynth.shutdown();
    sNativeSynth=null;
  }
  sNativeSynth=new SynthProxy(soFilename);
  currentSpeechEngineSOFile=soFilename;
  return TextToSpeech.SUCCESS;
}
Program: 42390
Project: 42390
Buggy source:
private int setEngine(String enginePackageName){
  String soFilename="String_Node_Str";
  if (enginePackageName.equals("String_Node_Str")) {
    soFilename="String_Node_Str";
  }
 else {
    Intent intent=new Intent("String_Node_Str");
    intent.setPackage(enginePackageName);
    ResolveInfo[] enginesArray=new ResolveInfo[0];
    PackageManager pm=getPackageManager();
    List<ResolveInfo> resolveInfos=pm.queryIntentActivities(intent,0);
    if ((resolveInfos == null) || resolveInfos.isEmpty()) {
      Log.e(SERVICE_TAG,"String_Node_Str" + enginePackageName);
      return TextToSpeech.ERROR;
    }
    enginesArray=resolveInfos.toArray(enginesArray);
    ActivityInfo aInfo=enginesArray[0].activityInfo;
    soFilename=aInfo.name.replace(aInfo.packageName + "String_Node_Str","String_Node_Str") + "String_Node_Str";
    soFilename=soFilename.toLowerCase();
    soFilename="String_Node_Str" + aInfo.packageName + "String_Node_Str"+ soFilename;
  }
  if (currentSpeechEngineSOFile.equals(soFilename)) {
    return TextToSpeech.SUCCESS;
  }
  File f=new File(soFilename);
  if (!f.exists()) {
    Log.e(SERVICE_TAG,"String_Node_Str" + soFilename);
    return TextToSpeech.ERROR;
  }
  if (sNativeSynth != null) {
    sNativeSynth.stopSync();
    sNativeSynth.shutdown();
    sNativeSynth=null;
  }
  sNativeSynth=new SynthProxy(soFilename);
  currentSpeechEngineSOFile=soFilename;
  return TextToSpeech.SUCCESS;
}

Fixed version (ground truth):
private int setEngine(String enginePackageName){
  String soFilename="String_Node_Str";
  if (isDefaultEnforced()) {
    enginePackageName=getDefaultEngine();
  }
  if (enginePackageName.equals("String_Node_Str")) {
    soFilename="String_Node_Str";
  }
 else {
    Intent intent=new Intent("String_Node_Str");
    intent.setPackage(enginePackageName);
    ResolveInfo[] enginesArray=new ResolveInfo[0];
    PackageManager pm=getPackageManager();
    List<ResolveInfo> resolveInfos=pm.queryIntentActivities(intent,0);
    if ((resolveInfos == null) || resolveInfos.isEmpty()) {
      Log.e(SERVICE_TAG,"String_Node_Str" + enginePackageName);
      return TextToSpeech.ERROR;
    }
    enginesArray=resolveInfos.toArray(enginesArray);
    ActivityInfo aInfo=enginesArray[0].activityInfo;
    soFilename=aInfo.name.replace(aInfo.packageName + "String_Node_Str","String_Node_Str") + "String_Node_Str";
    soFilename=soFilename.toLowerCase();
    soFilename="String_Node_Str" + aInfo.packageName + "String_Node_Str"+ soFilename;
  }
  if (currentSpeechEngineSOFile.equals(soFilename)) {
    return TextToSpeech.SUCCESS;
  }
  File f=new File(soFilename);
  if (!f.exists()) {
    Log.e(SERVICE_TAG,"String_Node_Str" + soFilename);
    return TextToSpeech.ERROR;
  }
  if (sNativeSynth != null) {
    sNativeSynth.stopSync();
    sNativeSynth.shutdown();
    sNativeSynth=null;
  }
  sNativeSynth=new SynthProxy(soFilename);
  currentSpeechEngineSOFile=soFilename;
  return TextToSpeech.SUCCESS;
}
Program: 42398
Project: 42398
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: 42399
Project: 42399
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: 42400
Project: 42400
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: 42401
Project: 42401
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: 42402
Project: 42402
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: 42403
Project: 42403
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: 42404
Project: 42404
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: 42405
Project: 42405
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: 42406
Project: 42406
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: 42407
Project: 42407
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: 42408
Project: 42408
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: 42409
Project: 42409
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: 42410
Project: 42410
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: 42411
Project: 42411
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: 42412
Project: 42412
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: 42413
Project: 42413
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: 42414
Project: 42414
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: 42415
Project: 42415
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: 42416
Project: 42416
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: 42417
Project: 42417
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: 42418
Project: 42418
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: 42419
Project: 42419
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: 42420
Project: 42420
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: 42421
Project: 42421
Buggy source:
void xmlBlockGone(){
synchronized (this) {
    decRefsLocked();
  }
}

Fixed version (ground truth):
void xmlBlockGone(int id){
synchronized (this) {
    decRefsLocked(id);
  }
}
Program: 42422
Project: 42422
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: 42423
Project: 42423
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: 42424
Project: 42424
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: 42426
Project: 42426
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: 42427
Project: 42427
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: 42429
Project: 42429
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: 42430
Project: 42430
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: 42431
Project: 42431
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);
  }
}