nus-yam/ex-repair huggingface dataset:
Program: 38184
Project: 38184
Buggy source:
@Override public void onDestroy(){
  if (mWakeLock != null && mWakeLock.isHeld()) {
    mWakeLock.release();
    Log.d(TAG,"String_Node_Str");
  }
  getContentResolver().unregisterContentObserver(mLocalImagesObserver);
  getContentResolver().unregisterContentObserver(mLocalVideosObserver);
  unregisterReceiver(mSDcardMountedReceiver);
  mCursor.close();
  mCursor=null;
  super.onDestroy();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  if (mWakeLock != null && mWakeLock.isHeld()) {
    mWakeLock.release();
    Log.d(TAG,"String_Node_Str");
  }
  if (mCursor != null) {
    getContentResolver().unregisterContentObserver(mLocalImagesObserver);
    getContentResolver().unregisterContentObserver(mLocalVideosObserver);
    unregisterReceiver(mSDcardMountedReceiver);
    mCursor.close();
    mCursor=null;
  }
  super.onDestroy();
}
Program: 38185
Project: 38185
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == REQ_CODE_DONT_SWITCH_TO_PREVIEW) {
    mResetToPreviewOnResume=false;
    mIsEditActivityInProgress=false;
  }
 else {
    super.onActivityResult(requestCode,resultCode,data);
    if (requestCode == PERMISSIONS_ACTIVITY_REQUEST_CODE && resultCode == PERMISSIONS_RESULT_CODE_FAILED) {
      finish();
    }
  }
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == REQ_CODE_DONT_SWITCH_TO_PREVIEW) {
    mResetToPreviewOnResume=false;
    mIsEditActivityInProgress=false;
  }
 else {
    super.onActivityResult(requestCode,resultCode,data);
  }
}
Program: 38186
Project: 38186
Buggy source:
@Override public void onUserInteraction(){
  super.onUserInteraction();
  mCurrentModule.onUserInteraction();
}

Fixed version (ground truth):
@Override public void onUserInteraction(){
  super.onUserInteraction();
  if (mCurrentModule != null) {
    mCurrentModule.onUserInteraction();
  }
}
Program: 38187
Project: 38187
Buggy source:
/** 
 * Checks if any of the needed Android runtime permissions are missing. If they are, then launch the permissions activity under one of the following conditions: a) The permissions dialogs have not run yet. We will ask for permission only once. b) If the missing permissions are critical to the app running, we will display a fatal error dialog. Critical permissions are: camera, microphone and storage. The app cannot run without them. Non-critical permission is location.
 */
private void checkPermissions(){
  if (checkSelfPermission(Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
    mHasCriticalPermissions=true;
  }
 else {
    mHasCriticalPermissions=false;
  }
  if ((checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) || !mHasCriticalPermissions) {
    Intent intent=new Intent(this,PermissionsActivity.class);
    startActivity(intent);
    finish();
  }
}

Fixed version (ground truth):
/** 
 * Checks if any of the needed Android runtime permissions are missing. If they are, then launch the permissions activity under one of the following conditions: a) If critical permissions are missing, display permission request again b) If non-critical permissions are missing, just display permission request once. Critical permissions are: camera, microphone and storage. The app cannot run without them. Non-critical permission is location.
 */
private boolean checkPermissions(){
  boolean requestPermission=false;
  if (checkSelfPermission(Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
    mHasCriticalPermissions=true;
  }
 else {
    mHasCriticalPermissions=false;
  }
  if ((checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) || !mHasCriticalPermissions) {
    final SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);
    boolean isRequestShown=prefs.getBoolean(CameraSettings.KEY_REQUEST_PERMISSION,false);
    if (!isRequestShown || !mHasCriticalPermissions) {
      Log.v(TAG,"String_Node_Str");
      Intent intent=new Intent(this,PermissionsActivity.class);
      startActivity(intent);
      SharedPreferences.Editor editor=prefs.edit();
      editor.putBoolean(CameraSettings.KEY_REQUEST_PERMISSION,true);
      editor.apply();
      requestPermission=true;
    }
  }
  return requestPermission;
}
Program: 38188
Project: 38188
Buggy source:
@Override public void onResume(){
  checkPermissions();
  if (!mHasCriticalPermissions) {
    super.onResume();
    Log.v(TAG,"String_Node_Str");
    finish();
    return;
  }
  this.setSystemBarsVisibility(false);
  UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,UsageStatistics.ACTION_FOREGROUNDED,this.getClass().getSimpleName());
  mOrientationListener.enable();
  mCurrentModule.onResumeBeforeSuper();
  super.onResume();
  mPaused=false;
  mCurrentModule.onResumeAfterSuper();
  setSwipingEnabled(true);
  if (mResetToPreviewOnResume) {
    mFilmStripView.getController().goToFirstItem();
  }
  mResetToPreviewOnResume=true;
  if (mLocalVideosObserver.isMediaDataChangedDuringPause() || mLocalImagesObserver.isMediaDataChangedDuringPause()) {
    if (!mSecureCamera) {
      mDataAdapter.requestLoad(getContentResolver());
      mThumbnailDrawable=null;
    }
  }
  mLocalImagesObserver.setActivityPaused(false);
  mLocalVideosObserver.setActivityPaused(false);
  Log.d(TAG,"String_Node_Str");
  Intent intent=new Intent("String_Node_Str");
  intent.putExtra("String_Node_Str",true);
  sendBroadcast(intent);
}

Fixed version (ground truth):
@Override public void onResume(){
  if (checkPermissions() || !mHasCriticalPermissions) {
    super.onResume();
    Log.v(TAG,"String_Node_Str");
    finish();
    return;
  }
  this.setSystemBarsVisibility(false);
  UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,UsageStatistics.ACTION_FOREGROUNDED,this.getClass().getSimpleName());
  mOrientationListener.enable();
  mCurrentModule.onResumeBeforeSuper();
  super.onResume();
  mPaused=false;
  mCurrentModule.onResumeAfterSuper();
  setSwipingEnabled(true);
  if (mResetToPreviewOnResume) {
    mFilmStripView.getController().goToFirstItem();
  }
  mResetToPreviewOnResume=true;
  if (mLocalVideosObserver.isMediaDataChangedDuringPause() || mLocalImagesObserver.isMediaDataChangedDuringPause()) {
    if (!mSecureCamera) {
      mDataAdapter.requestLoad(getContentResolver());
      mThumbnailDrawable=null;
    }
  }
  mLocalImagesObserver.setActivityPaused(false);
  mLocalVideosObserver.setActivityPaused(false);
  Log.d(TAG,"String_Node_Str");
  Intent intent=new Intent("String_Node_Str");
  intent.putExtra("String_Node_Str",true);
  sendBroadcast(intent);
}
Program: 38190
Project: 38190
Buggy source:
@Override public void onRequestPermissionsResult(int requestCode,String permissions[],int[] grantResults){
  if (mShouldRequestCameraPermission) {
    if (grantResults[mIndexPermissionRequestCamera] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasCameraPermission=true;
    }
 else {
      handlePermissionsFailure();
    }
  }
  if (mShouldRequestMicrophonePermission) {
    if (grantResults[mIndexPermissionRequestMicrophone] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasMicrophonePermission=true;
    }
 else {
      handlePermissionsFailure();
    }
  }
  if (mShouldRequestStoragePermission) {
    if (grantResults[mIndexPermissionRequestStorage] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasStoragePermission=true;
    }
 else {
      handlePermissionsFailure();
    }
  }
  if (mShouldRequestLocationPermission) {
    if (grantResults[mIndexPermissionRequestLocation] == PackageManager.PERMISSION_GRANTED) {
    }
 else {
    }
  }
  if (mFlagHasCameraPermission && mFlagHasMicrophonePermission && mFlagHasStoragePermission) {
    handlePermissionsSuccess();
  }
}

Fixed version (ground truth):
@Override public void onRequestPermissionsResult(int requestCode,String permissions[],int[] grantResults){
  if (mShouldRequestCameraPermission) {
    if (grantResults[mIndexPermissionRequestCamera] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasCameraPermission=true;
    }
 else {
      mCriticalPermissionDenied=true;
    }
  }
  if (mShouldRequestMicrophonePermission) {
    if (grantResults[mIndexPermissionRequestMicrophone] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasMicrophonePermission=true;
    }
 else {
      mCriticalPermissionDenied=true;
    }
  }
  if (mShouldRequestStoragePermission) {
    if (grantResults[mIndexPermissionRequestStorage] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasStoragePermission=true;
    }
 else {
      mCriticalPermissionDenied=true;
    }
  }
  if (mShouldRequestLocationPermission) {
    if (grantResults[mIndexPermissionRequestLocation] == PackageManager.PERMISSION_GRANTED) {
    }
 else {
    }
  }
  if (mFlagHasCameraPermission && mFlagHasMicrophonePermission && mFlagHasStoragePermission) {
    handlePermissionsSuccess();
  }
 else   if (mCriticalPermissionDenied) {
    handlePermissionsFailure();
  }
}
Program: 38191
Project: 38191
Buggy source:
@Override protected void onResume(){
  super.onResume();
  mNumPermissionsToRequest=0;
  checkPermissions();
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  if (!mCriticalPermissionDenied) {
    mNumPermissionsToRequest=0;
    checkPermissions();
  }
 else {
    mCriticalPermissionDenied=false;
  }
}
Program: 38192
Project: 38192
Buggy source:
@Override public void onDestroy(){
  if (mWakeLock != null && mWakeLock.isHeld()) {
    mWakeLock.release();
    Log.d(TAG,"String_Node_Str");
  }
  getContentResolver().unregisterContentObserver(mLocalImagesObserver);
  getContentResolver().unregisterContentObserver(mLocalVideosObserver);
  unregisterReceiver(mSDcardMountedReceiver);
  mCursor.close();
  mCursor=null;
  super.onDestroy();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  if (mWakeLock != null && mWakeLock.isHeld()) {
    mWakeLock.release();
    Log.d(TAG,"String_Node_Str");
  }
  if (mCursor != null) {
    getContentResolver().unregisterContentObserver(mLocalImagesObserver);
    getContentResolver().unregisterContentObserver(mLocalVideosObserver);
    unregisterReceiver(mSDcardMountedReceiver);
    mCursor.close();
    mCursor=null;
  }
  super.onDestroy();
}
Program: 38193
Project: 38193
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == REQ_CODE_DONT_SWITCH_TO_PREVIEW) {
    mResetToPreviewOnResume=false;
    mIsEditActivityInProgress=false;
  }
 else {
    super.onActivityResult(requestCode,resultCode,data);
    if (requestCode == PERMISSIONS_ACTIVITY_REQUEST_CODE && resultCode == PERMISSIONS_RESULT_CODE_FAILED) {
      finish();
    }
  }
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == REQ_CODE_DONT_SWITCH_TO_PREVIEW) {
    mResetToPreviewOnResume=false;
    mIsEditActivityInProgress=false;
  }
 else {
    super.onActivityResult(requestCode,resultCode,data);
  }
}
Program: 38194
Project: 38194
Buggy source:
@Override public void onUserInteraction(){
  super.onUserInteraction();
  mCurrentModule.onUserInteraction();
}

Fixed version (ground truth):
@Override public void onUserInteraction(){
  super.onUserInteraction();
  if (mCurrentModule != null) {
    mCurrentModule.onUserInteraction();
  }
}
Program: 38195
Project: 38195
Buggy source:
/** 
 * Checks if any of the needed Android runtime permissions are missing. If they are, then launch the permissions activity under one of the following conditions: a) The permissions dialogs have not run yet. We will ask for permission only once. b) If the missing permissions are critical to the app running, we will display a fatal error dialog. Critical permissions are: camera, microphone and storage. The app cannot run without them. Non-critical permission is location.
 */
private void checkPermissions(){
  if (checkSelfPermission(Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
    mHasCriticalPermissions=true;
  }
 else {
    mHasCriticalPermissions=false;
  }
  if ((checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) || !mHasCriticalPermissions) {
    Intent intent=new Intent(this,PermissionsActivity.class);
    startActivity(intent);
    finish();
  }
}

Fixed version (ground truth):
/** 
 * Checks if any of the needed Android runtime permissions are missing. If they are, then launch the permissions activity under one of the following conditions: a) If critical permissions are missing, display permission request again b) If non-critical permissions are missing, just display permission request once. Critical permissions are: camera, microphone and storage. The app cannot run without them. Non-critical permission is location.
 */
private boolean checkPermissions(){
  boolean requestPermission=false;
  if (checkSelfPermission(Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
    mHasCriticalPermissions=true;
  }
 else {
    mHasCriticalPermissions=false;
  }
  if ((checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) || !mHasCriticalPermissions) {
    final SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);
    boolean isRequestShown=prefs.getBoolean(CameraSettings.KEY_REQUEST_PERMISSION,false);
    if (!isRequestShown || !mHasCriticalPermissions) {
      Log.v(TAG,"String_Node_Str");
      Intent intent=new Intent(this,PermissionsActivity.class);
      startActivity(intent);
      SharedPreferences.Editor editor=prefs.edit();
      editor.putBoolean(CameraSettings.KEY_REQUEST_PERMISSION,true);
      editor.apply();
      requestPermission=true;
    }
  }
  return requestPermission;
}
Program: 38196
Project: 38196
Buggy source:
@Override public void onResume(){
  checkPermissions();
  if (!mHasCriticalPermissions) {
    super.onResume();
    Log.v(TAG,"String_Node_Str");
    finish();
    return;
  }
  this.setSystemBarsVisibility(false);
  UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,UsageStatistics.ACTION_FOREGROUNDED,this.getClass().getSimpleName());
  mOrientationListener.enable();
  mCurrentModule.onResumeBeforeSuper();
  super.onResume();
  mPaused=false;
  mCurrentModule.onResumeAfterSuper();
  setSwipingEnabled(true);
  if (mResetToPreviewOnResume) {
    mFilmStripView.getController().goToFirstItem();
  }
  mResetToPreviewOnResume=true;
  if (mLocalVideosObserver.isMediaDataChangedDuringPause() || mLocalImagesObserver.isMediaDataChangedDuringPause()) {
    if (!mSecureCamera) {
      mDataAdapter.requestLoad(getContentResolver());
      mThumbnailDrawable=null;
    }
  }
  mLocalImagesObserver.setActivityPaused(false);
  mLocalVideosObserver.setActivityPaused(false);
  Log.d(TAG,"String_Node_Str");
  Intent intent=new Intent("String_Node_Str");
  intent.putExtra("String_Node_Str",true);
  sendBroadcast(intent);
}

Fixed version (ground truth):
@Override public void onResume(){
  if (checkPermissions() || !mHasCriticalPermissions) {
    super.onResume();
    Log.v(TAG,"String_Node_Str");
    finish();
    return;
  }
  this.setSystemBarsVisibility(false);
  UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,UsageStatistics.ACTION_FOREGROUNDED,this.getClass().getSimpleName());
  mOrientationListener.enable();
  mCurrentModule.onResumeBeforeSuper();
  super.onResume();
  mPaused=false;
  mCurrentModule.onResumeAfterSuper();
  setSwipingEnabled(true);
  if (mResetToPreviewOnResume) {
    mFilmStripView.getController().goToFirstItem();
  }
  mResetToPreviewOnResume=true;
  if (mLocalVideosObserver.isMediaDataChangedDuringPause() || mLocalImagesObserver.isMediaDataChangedDuringPause()) {
    if (!mSecureCamera) {
      mDataAdapter.requestLoad(getContentResolver());
      mThumbnailDrawable=null;
    }
  }
  mLocalImagesObserver.setActivityPaused(false);
  mLocalVideosObserver.setActivityPaused(false);
  Log.d(TAG,"String_Node_Str");
  Intent intent=new Intent("String_Node_Str");
  intent.putExtra("String_Node_Str",true);
  sendBroadcast(intent);
}
Program: 38198
Project: 38198
Buggy source:
@Override public void onRequestPermissionsResult(int requestCode,String permissions[],int[] grantResults){
  if (mShouldRequestCameraPermission) {
    if (grantResults[mIndexPermissionRequestCamera] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasCameraPermission=true;
    }
 else {
      handlePermissionsFailure();
    }
  }
  if (mShouldRequestMicrophonePermission) {
    if (grantResults[mIndexPermissionRequestMicrophone] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasMicrophonePermission=true;
    }
 else {
      handlePermissionsFailure();
    }
  }
  if (mShouldRequestStoragePermission) {
    if (grantResults[mIndexPermissionRequestStorage] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasStoragePermission=true;
    }
 else {
      handlePermissionsFailure();
    }
  }
  if (mShouldRequestLocationPermission) {
    if (grantResults[mIndexPermissionRequestLocation] == PackageManager.PERMISSION_GRANTED) {
    }
 else {
    }
  }
  if (mFlagHasCameraPermission && mFlagHasMicrophonePermission && mFlagHasStoragePermission) {
    handlePermissionsSuccess();
  }
}

Fixed version (ground truth):
@Override public void onRequestPermissionsResult(int requestCode,String permissions[],int[] grantResults){
  if (mShouldRequestCameraPermission) {
    if (grantResults[mIndexPermissionRequestCamera] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasCameraPermission=true;
    }
 else {
      mCriticalPermissionDenied=true;
    }
  }
  if (mShouldRequestMicrophonePermission) {
    if (grantResults[mIndexPermissionRequestMicrophone] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasMicrophonePermission=true;
    }
 else {
      mCriticalPermissionDenied=true;
    }
  }
  if (mShouldRequestStoragePermission) {
    if (grantResults[mIndexPermissionRequestStorage] == PackageManager.PERMISSION_GRANTED) {
      mFlagHasStoragePermission=true;
    }
 else {
      mCriticalPermissionDenied=true;
    }
  }
  if (mShouldRequestLocationPermission) {
    if (grantResults[mIndexPermissionRequestLocation] == PackageManager.PERMISSION_GRANTED) {
    }
 else {
    }
  }
  if (mFlagHasCameraPermission && mFlagHasMicrophonePermission && mFlagHasStoragePermission) {
    handlePermissionsSuccess();
  }
 else   if (mCriticalPermissionDenied) {
    handlePermissionsFailure();
  }
}
Program: 38199
Project: 38199
Buggy source:
@Override protected void onResume(){
  super.onResume();
  mNumPermissionsToRequest=0;
  checkPermissions();
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  if (!mCriticalPermissionDenied) {
    mNumPermissionsToRequest=0;
    checkPermissions();
  }
 else {
    mCriticalPermissionDenied=false;
  }
}
Program: 38201
Project: 38201
Buggy source:
@Override public void onLayoutChange(View v,int left,int top,int right,int bottom,int oldLeft,int oldTop,int oldRight,int oldBottom){
  int width=right - left;
  int height=bottom - top;
  tryToCloseSubList();
  if (mMaxPreviewWidth == 0 && mMaxPreviewHeight == 0) {
    mMaxPreviewWidth=width;
    mMaxPreviewHeight=height;
  }
  if (mOrientationResize != mPrevOrientationResize || mAspectRatioResize) {
    layoutPreview(mAspectRatio);
    mAspectRatioResize=false;
  }
}

Fixed version (ground truth):
@Override public void onLayoutChange(View v,int left,int top,int right,int bottom,int oldLeft,int oldTop,int oldRight,int oldBottom){
  int width=right - left;
  int height=bottom - top;
  tryToCloseSubList();
  if (mMaxPreviewWidth == 0 && mMaxPreviewHeight == 0) {
    mMaxPreviewWidth=width;
    mMaxPreviewHeight=height;
  }
  if (mOrientationResize != mPrevOrientationResize || mAspectRatioResize || !mIsLayoutInitializedAlready) {
    layoutPreview(mAspectRatio);
    mAspectRatioResize=false;
  }
}
Program: 38204
Project: 38204
Buggy source:
@Override public void onLayoutChange(View v,int left,int top,int right,int bottom,int oldLeft,int oldTop,int oldRight,int oldBottom){
  int width=right - left;
  int height=bottom - top;
  tryToCloseSubList();
  if (mMaxPreviewWidth == 0 && mMaxPreviewHeight == 0) {
    mMaxPreviewWidth=width;
    mMaxPreviewHeight=height;
  }
  if (mOrientationResize != mPrevOrientationResize || mAspectRatioResize) {
    layoutPreview(mAspectRatio);
    mAspectRatioResize=false;
  }
}

Fixed version (ground truth):
@Override public void onLayoutChange(View v,int left,int top,int right,int bottom,int oldLeft,int oldTop,int oldRight,int oldBottom){
  int width=right - left;
  int height=bottom - top;
  tryToCloseSubList();
  if (mMaxPreviewWidth == 0 && mMaxPreviewHeight == 0) {
    mMaxPreviewWidth=width;
    mMaxPreviewHeight=height;
  }
  if (mOrientationResize != mPrevOrientationResize || mAspectRatioResize || !mIsLayoutInitializedAlready) {
    layoutPreview(mAspectRatio);
    mAspectRatioResize=false;
  }
}
Program: 38206
Project: 38206
Buggy source:
public void onSingleTapUp(int x,int y){
  if (!mInitialized || mState == STATE_FOCUSING_SNAP_ON_FINISH)   return;
  UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,UsageStatistics.ACTION_TOUCH_FOCUS,x + "String_Node_Str" + y);
  if ((mFocusArea != null) && (mState == STATE_FOCUSING || mState == STATE_SUCCESS || mState == STATE_FAIL)) {
    cancelAutoFocus();
  }
  if (mPreviewRect.width() == 0 || mPreviewRect.height() == 0)   return;
  if (mFocusAreaSupported) {
    initializeFocusAreas(x,y);
  }
  if (mMeteringAreaSupported) {
    initializeMeteringAreas(x,y);
  }
  mUI.setFocusPosition(x,y);
  if (mZslEnabled) {
    mTouchAFRunning=true;
  }
  mListener.stopFaceDetection();
  mListener.setFocusParameters();
  if (mFocusAreaSupported) {
    autoFocus();
  }
 else {
    updateFocusUI();
    mHandler.removeMessages(RESET_TOUCH_FOCUS);
    mHandler.sendEmptyMessageDelayed(RESET_TOUCH_FOCUS,RESET_TOUCH_FOCUS_DELAY);
  }
}

Fixed version (ground truth):
public void onSingleTapUp(int x,int y){
  if (!mInitialized || mState == STATE_FOCUSING_SNAP_ON_FINISH)   return;
  UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,UsageStatistics.ACTION_TOUCH_FOCUS,x + "String_Node_Str" + y);
  if ((mState == STATE_FOCUSING || mState == STATE_SUCCESS || mState == STATE_FAIL)) {
    cancelAutoFocus();
  }
  if (mPreviewRect.width() == 0 || mPreviewRect.height() == 0)   return;
  if (mFocusAreaSupported) {
    initializeFocusAreas(x,y);
  }
  if (mMeteringAreaSupported) {
    initializeMeteringAreas(x,y);
  }
  mUI.setFocusPosition(x,y);
  if (mZslEnabled) {
    mTouchAFRunning=true;
  }
  mListener.stopFaceDetection();
  mListener.setFocusParameters();
  if (mFocusAreaSupported) {
    autoFocus();
  }
 else {
    updateFocusUI();
    mHandler.removeMessages(RESET_TOUCH_FOCUS);
    mHandler.sendEmptyMessageDelayed(RESET_TOUCH_FOCUS,RESET_TOUCH_FOCUS_DELAY);
  }
}
Program: 38207
Project: 38207
Buggy source:
public boolean is4KEnabled(){
  if (mProfile.quality == CamcorderProfile.QUALITY_2160P || mProfile.quality == CamcorderProfile.QUALITY_4KDCI) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public boolean is4KEnabled(){
  if (mProfile.quality == CamcorderProfile.QUALITY_2160P || mProfile.quality == CamcorderProfile.QUALITY_TIME_LAPSE_2160P || mProfile.quality == CamcorderProfile.QUALITY_4KDCI) {
    return true;
  }
 else {
    return false;
  }
}
Program: 38208
Project: 38208
Buggy source:
@Override public void onResumeAfterSuper(){
  mLastPhotoTakenWithRefocus=false;
  String action=mActivity.getIntent().getAction();
  if (MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA.equals(action) || MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action)) {
    Log.v(TAG,"String_Node_Str");
    mHandler.postDelayed(new Runnable(){
      public void run(){
        onResumeTasks();
        if (isInstantCaptureEnabled()) {
          mInstantCaptureSnapShot=true;
        }
      }
    }
,ON_RESUME_TASKS_DELAY_MSEC);
  }
 else {
    Log.v(TAG,"String_Node_Str");
    onResumeTasks();
  }
  mUI.setSwitcherIndex();
  if (mSoundPool == null) {
    mSoundPool=new SoundPool(1,AudioManager.STREAM_NOTIFICATION,0);
    mRefocusSound=mSoundPool.load(mActivity,R.raw.camera_click_x5,1);
  }
  mHandler.post(new Runnable(){
    @Override public void run(){
      mActivity.updateStorageSpaceAndHint();
      updateRemainingPhotos();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onResumeAfterSuper(){
  mLastPhotoTakenWithRefocus=false;
  String action=mActivity.getIntent().getAction();
  if (MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA.equals(action) || MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action)) {
    Log.v(TAG,"String_Node_Str");
    if (isInstantCaptureEnabled()) {
      mInstantCaptureSnapShot=true;
    }
    mHandler.postDelayed(new Runnable(){
      public void run(){
        onResumeTasks();
      }
    }
,ON_RESUME_TASKS_DELAY_MSEC);
  }
 else {
    Log.v(TAG,"String_Node_Str");
    onResumeTasks();
  }
  mUI.setSwitcherIndex();
  if (mSoundPool == null) {
    mSoundPool=new SoundPool(1,AudioManager.STREAM_NOTIFICATION,0);
    mRefocusSound=mSoundPool.load(mActivity,R.raw.camera_click_x5,1);
  }
  mHandler.post(new Runnable(){
    @Override public void run(){
      mActivity.updateStorageSpaceAndHint();
      updateRemainingPhotos();
    }
  }
);
}
Program: 38209
Project: 38209
Buggy source:
@Override public void onResumeAfterSuper(){
  mLastPhotoTakenWithRefocus=false;
  mUI.showSurfaceView();
  String action=mActivity.getIntent().getAction();
  if (MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA.equals(action) || MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action)) {
    Log.v(TAG,"String_Node_Str");
    mHandler.postDelayed(new Runnable(){
      public void run(){
        onResumeTasks();
        if (isInstantCaptureEnabled()) {
          mInstantCaptureSnapShot=true;
        }
      }
    }
,ON_RESUME_TASKS_DELAY_MSEC);
  }
 else {
    Log.v(TAG,"String_Node_Str");
    onResumeTasks();
  }
  mUI.setSwitcherIndex();
  if (mSoundPool == null) {
    mSoundPool=new SoundPool(1,AudioManager.STREAM_NOTIFICATION,0);
    mRefocusSound=mSoundPool.load(mActivity,R.raw.camera_click_x5,1);
  }
  mHandler.post(new Runnable(){
    @Override public void run(){
      mActivity.updateStorageSpaceAndHint();
      updateRemainingPhotos();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onResumeAfterSuper(){
  mLastPhotoTakenWithRefocus=false;
  mUI.showSurfaceView();
  String action=mActivity.getIntent().getAction();
  if (MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA.equals(action) || MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action)) {
    Log.v(TAG,"String_Node_Str");
    if (isInstantCaptureEnabled()) {
      mInstantCaptureSnapShot=true;
    }
    mHandler.postDelayed(new Runnable(){
      public void run(){
        onResumeTasks();
      }
    }
,ON_RESUME_TASKS_DELAY_MSEC);
  }
 else {
    Log.v(TAG,"String_Node_Str");
    onResumeTasks();
  }
  mUI.setSwitcherIndex();
  if (mSoundPool == null) {
    mSoundPool=new SoundPool(1,AudioManager.STREAM_NOTIFICATION,0);
    mRefocusSound=mSoundPool.load(mActivity,R.raw.camera_click_x5,1);
  }
  mHandler.post(new Runnable(){
    @Override public void run(){
      mActivity.updateStorageSpaceAndHint();
      updateRemainingPhotos();
    }
  }
);
}
Program: 38210
Project: 38210
Buggy source:
public boolean is4KEnabled(){
  if (mProfile.quality == CamcorderProfile.QUALITY_2160P || mProfile.quality == CamcorderProfile.QUALITY_4KDCI) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public boolean is4KEnabled(){
  if (mProfile.quality == CamcorderProfile.QUALITY_2160P || mProfile.quality == CamcorderProfile.QUALITY_TIME_LAPSE_2160P || mProfile.quality == CamcorderProfile.QUALITY_4KDCI) {
    return true;
  }
 else {
    return false;
  }
}
Program: 38211
Project: 38211
Buggy source:
public void onSingleTapUp(int x,int y){
  if (!mInitialized || mState == STATE_FOCUSING_SNAP_ON_FINISH)   return;
  UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,UsageStatistics.ACTION_TOUCH_FOCUS,x + "String_Node_Str" + y);
  if ((mFocusArea != null) && (mState == STATE_FOCUSING || mState == STATE_SUCCESS || mState == STATE_FAIL)) {
    cancelAutoFocus();
  }
  if (mPreviewRect.width() == 0 || mPreviewRect.height() == 0)   return;
  if (mFocusAreaSupported) {
    initializeFocusAreas(x,y);
  }
  if (mMeteringAreaSupported) {
    initializeMeteringAreas(x,y);
  }
  mUI.setFocusPosition(x,y);
  if (mZslEnabled) {
    mTouchAFRunning=true;
  }
  mListener.stopFaceDetection();
  mListener.setFocusParameters();
  if (mFocusAreaSupported) {
    autoFocus();
  }
 else {
    updateFocusUI();
    mHandler.removeMessages(RESET_TOUCH_FOCUS);
    mHandler.sendEmptyMessageDelayed(RESET_TOUCH_FOCUS,RESET_TOUCH_FOCUS_DELAY);
  }
}

Fixed version (ground truth):
public void onSingleTapUp(int x,int y){
  if (!mInitialized || mState == STATE_FOCUSING_SNAP_ON_FINISH)   return;
  UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,UsageStatistics.ACTION_TOUCH_FOCUS,x + "String_Node_Str" + y);
  if ((mState == STATE_FOCUSING || mState == STATE_SUCCESS || mState == STATE_FAIL)) {
    cancelAutoFocus();
  }
  if (mPreviewRect.width() == 0 || mPreviewRect.height() == 0)   return;
  if (mFocusAreaSupported) {
    initializeFocusAreas(x,y);
  }
  if (mMeteringAreaSupported) {
    initializeMeteringAreas(x,y);
  }
  mUI.setFocusPosition(x,y);
  if (mZslEnabled) {
    mTouchAFRunning=true;
  }
  mListener.stopFaceDetection();
  mListener.setFocusParameters();
  if (mFocusAreaSupported) {
    autoFocus();
  }
 else {
    updateFocusUI();
    mHandler.removeMessages(RESET_TOUCH_FOCUS);
    mHandler.sendEmptyMessageDelayed(RESET_TOUCH_FOCUS,RESET_TOUCH_FOCUS_DELAY);
  }
}
Program: 38212
Project: 38212
Buggy source:
public void initSwitchItem(final String prefKey,View switcher){
  final IconListPreference pref=(IconListPreference)mPreferenceGroup.findPreference(prefKey);
  if (pref == null)   return;
  int[] iconIds=pref.getLargeIconIds();
  int resid=-1;
  int index=pref.findIndexOfValue(pref.getValue());
  if (!pref.getUseSingleIcon() && iconIds != null) {
    resid=iconIds[index];
  }
 else {
    resid=pref.getSingleIcon();
  }
  ((ImageView)switcher).setImageResource(resid);
  switcher.setVisibility(View.VISIBLE);
  mPreferences.add(pref);
  mPreferenceMap.put(pref,switcher);
  switcher.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      IconListPreference pref=(IconListPreference)mPreferenceGroup.findPreference(prefKey);
      if (pref == null)       return;
      int index=pref.findIndexOfValue(pref.getValue());
      CharSequence[] values=pref.getEntryValues();
      index=(index + 1) % values.length;
      pref.setValueIndex(index);
      ((ImageView)v).setImageResource(((IconListPreference)pref).getLargeIconIds()[index]);
      if (prefKey.equals(CameraSettings.KEY_CAMERA_ID))       mListener.onCameraPickerClicked(index);
      reloadPreference(pref);
      onSettingChanged(pref);
    }
  }
);
}

Fixed version (ground truth):
public void initSwitchItem(final String prefKey,View switcher){
  final IconListPreference pref=(IconListPreference)mPreferenceGroup.findPreference(prefKey);
  if (pref == null)   return;
  int[] iconIds=pref.getLargeIconIds();
  int resid=-1;
  int index=pref.findIndexOfValue(pref.getValue());
  if (!pref.getUseSingleIcon() && iconIds != null) {
    resid=iconIds[index];
  }
 else {
    resid=pref.getSingleIcon();
  }
  ((ImageView)switcher).setImageResource(resid);
  switcher.setVisibility(View.VISIBLE);
  mPreferences.add(pref);
  mPreferenceMap.put(pref,switcher);
  switcher.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      IconListPreference pref=(IconListPreference)mPreferenceGroup.findPreference(prefKey);
      if (pref == null)       return;
      mUI.hideUI();
      int index=pref.findIndexOfValue(pref.getValue());
      CharSequence[] values=pref.getEntryValues();
      index=(index + 1) % values.length;
      pref.setValueIndex(index);
      ((ImageView)v).setImageResource(((IconListPreference)pref).getLargeIconIds()[index]);
      if (prefKey.equals(CameraSettings.KEY_CAMERA_ID))       mListener.onCameraPickerClicked(index);
      reloadPreference(pref);
      onSettingChanged(pref);
    }
  }
);
}
Program: 38213
Project: 38213
Buggy source:
public void initSwitchItem(final String prefKey,View switcher){
  final IconListPreference pref=(IconListPreference)mPreferenceGroup.findPreference(prefKey);
  if (pref == null)   return;
  int[] iconIds=pref.getLargeIconIds();
  int resid=-1;
  int index=pref.findIndexOfValue(pref.getValue());
  if (!pref.getUseSingleIcon() && iconIds != null) {
    resid=iconIds[index];
  }
 else {
    resid=pref.getSingleIcon();
  }
  ((ImageView)switcher).setImageResource(resid);
  switcher.setVisibility(View.VISIBLE);
  mPreferences.add(pref);
  mPreferenceMap.put(pref,switcher);
  switcher.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      IconListPreference pref=(IconListPreference)mPreferenceGroup.findPreference(prefKey);
      if (pref == null)       return;
      int index=pref.findIndexOfValue(pref.getValue());
      CharSequence[] values=pref.getEntryValues();
      index=(index + 1) % values.length;
      pref.setValueIndex(index);
      ((ImageView)v).setImageResource(((IconListPreference)pref).getLargeIconIds()[index]);
      if (prefKey.equals(CameraSettings.KEY_CAMERA_ID))       mListener.onCameraPickerClicked(index);
      reloadPreference(pref);
      onSettingChanged(pref);
    }
  }
);
}

Fixed version (ground truth):
public void initSwitchItem(final String prefKey,View switcher){
  final IconListPreference pref=(IconListPreference)mPreferenceGroup.findPreference(prefKey);
  if (pref == null)   return;
  int[] iconIds=pref.getLargeIconIds();
  int resid=-1;
  int index=pref.findIndexOfValue(pref.getValue());
  if (!pref.getUseSingleIcon() && iconIds != null) {
    resid=iconIds[index];
  }
 else {
    resid=pref.getSingleIcon();
  }
  ((ImageView)switcher).setImageResource(resid);
  switcher.setVisibility(View.VISIBLE);
  mPreferences.add(pref);
  mPreferenceMap.put(pref,switcher);
  switcher.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      IconListPreference pref=(IconListPreference)mPreferenceGroup.findPreference(prefKey);
      if (pref == null)       return;
      mUI.hideUI();
      int index=pref.findIndexOfValue(pref.getValue());
      CharSequence[] values=pref.getEntryValues();
      index=(index + 1) % values.length;
      pref.setValueIndex(index);
      ((ImageView)v).setImageResource(((IconListPreference)pref).getLargeIconIds()[index]);
      if (prefKey.equals(CameraSettings.KEY_CAMERA_ID))       mListener.onCameraPickerClicked(index);
      reloadPreference(pref);
      onSettingChanged(pref);
    }
  }
);
}
Program: 38214
Project: 38214
Buggy source:
@Override public void onError(MediaRecorder mr,int what,int extra){
  Log.e(TAG,"String_Node_Str" + what + "String_Node_Str"+ extra);
  stopVideoRecording();
  if (what == MediaRecorder.MEDIA_RECORDER_ERROR_UNKNOWN) {
    mActivity.updateStorageSpaceAndHint();
  }
}

Fixed version (ground truth):
@Override public void onError(MediaRecorder mr,int what,int extra){
  Log.e(TAG,"String_Node_Str" + what + "String_Node_Str"+ extra);
  stopVideoRecording();
  mUI.showUIafterRecording();
  if (what == MediaRecorder.MEDIA_RECORDER_ERROR_UNKNOWN) {
    mActivity.updateStorageSpaceAndHint();
  }
}
Program: 38217
Project: 38217
Buggy source:
public void onListMenuTouched(){
  mUI.removeLevel2();
}

Fixed version (ground truth):
public void onListMenuTouched(){
  mUI.removeLevel2();
  mPopupStatus=POPUP_FIRST_LEVEL;
}
Program: 38218
Project: 38218
Buggy source:
public void onListMenuTouched(){
  mUI.removeLevel2();
}

Fixed version (ground truth):
public void onListMenuTouched(){
  mUI.removeLevel2();
  mPopupStatus=POPUP_FIRST_LEVEL;
}
Program: 38219
Project: 38219
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  return super.onTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_MOVE) {
    mListener.onListMenuTouched();
    resetHighlight();
  }
  return super.onTouchEvent(ev);
}
Program: 38220
Project: 38220
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  sFirstStartAfterScreenOn=true;
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Log.d(TAG,"String_Node_Str");
  updateStorageSpaceAndHint();
}
Program: 38221
Project: 38221
Buggy source:
@Override public void onDestroy(){
  if (mWakeLock != null && mWakeLock.isHeld()) {
    mWakeLock.release();
    Log.d(TAG,"String_Node_Str");
  }
  if (mScreenOffReceiver != null) {
    unregisterReceiver(mScreenOffReceiver);
  }
  getContentResolver().unregisterContentObserver(mLocalImagesObserver);
  getContentResolver().unregisterContentObserver(mLocalVideosObserver);
  unregisterReceiver(mSDcardMountedReceiver);
  super.onDestroy();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  if (mWakeLock != null && mWakeLock.isHeld()) {
    mWakeLock.release();
    Log.d(TAG,"String_Node_Str");
  }
  getContentResolver().unregisterContentObserver(mLocalImagesObserver);
  getContentResolver().unregisterContentObserver(mLocalVideosObserver);
  unregisterReceiver(mSDcardMountedReceiver);
  super.onDestroy();
}
Program: 38223
Project: 38223
Buggy source:
private void closeCamera(){
  Log.v(TAG,"String_Node_Str");
  if (mCameraDevice != null) {
    mCameraDevice.setZoomChangeListener(null);
    mCameraDevice.setFaceDetectionCallback(null,null);
    mCameraDevice.setErrorCallback(null);
    if (mActivity.isSecureCamera() && !CameraActivity.isFirstStartAfterScreenOn()) {
      CameraHolder.instance().strongRelease();
    }
 else {
      CameraHolder.instance().release();
    }
    mFaceDetectionStarted=false;
    mCameraDevice=null;
    setCameraState(PREVIEW_STOPPED);
    if (mFocusManager != null) {
      mFocusManager.onCameraReleased();
    }
  }
}

Fixed version (ground truth):
private void closeCamera(){
  Log.v(TAG,"String_Node_Str");
  if (mCameraDevice != null) {
    mCameraDevice.setZoomChangeListener(null);
    mCameraDevice.setFaceDetectionCallback(null,null);
    mCameraDevice.setErrorCallback(null);
    if (mActivity.isSecureCamera()) {
      CameraHolder.instance().strongRelease();
    }
 else {
      CameraHolder.instance().release();
    }
    mFaceDetectionStarted=false;
    mCameraDevice=null;
    setCameraState(PREVIEW_STOPPED);
    if (mFocusManager != null) {
      mFocusManager.onCameraReleased();
    }
  }
}
Program: 38224
Project: 38224
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (action.equals(Intent.ACTION_MEDIA_EJECT)) {
    stopVideoRecording();
    RotateTextToast.makeText(mActivity,mActivity.getResources().getString(R.string.video_recording_stopped),Toast.LENGTH_SHORT).show();
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (action.equals(Intent.ACTION_MEDIA_EJECT) || action.equals(Intent.ACTION_SCREEN_OFF)) {
    stopVideoRecording();
    RotateTextToast.makeText(mActivity,mActivity.getResources().getString(R.string.video_recording_stopped),Toast.LENGTH_SHORT).show();
  }
}
Program: 38225
Project: 38225
Buggy source:
@Override public void installIntentFilter(){
  if (mReceiver != null)   return;
  IntentFilter intentFilter=new IntentFilter(Intent.ACTION_MEDIA_EJECT);
  intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
  intentFilter.addDataScheme("String_Node_Str");
  mReceiver=new MyBroadcastReceiver();
  mActivity.registerReceiver(mReceiver,intentFilter);
}

Fixed version (ground truth):
@Override public void installIntentFilter(){
  if (mReceiver != null)   return;
  IntentFilter intentFilter=new IntentFilter(Intent.ACTION_MEDIA_EJECT);
  intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
  intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
  intentFilter.addDataScheme("String_Node_Str");
  mReceiver=new MyBroadcastReceiver();
  mActivity.registerReceiver(mReceiver,intentFilter);
}
Program: 38227
Project: 38227
Buggy source:
private String getSDCardStorageState(){
  try {
    return mMountService.getVolumeState(mVolume.getPath());
  }
 catch (  Exception e) {
    Log.w(TAG,"String_Node_Str" + e);
    return Environment.MEDIA_REMOVED;
  }
}

Fixed version (ground truth):
private String getSDCardStorageState(){
  return mVolume.getState();
}
Program: 38231
Project: 38231
Buggy source:
@Override public void onResumeAfterSuper(){
  mLastPhotoTakenWithRefocus=false;
  String action=mActivity.getIntent().getAction();
  if (MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA.equals(action) || MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action)) {
    Log.v(TAG,"String_Node_Str");
    mHandler.postDelayed(new Runnable(){
      public void run(){
        onResumeTasks();
      }
    }
,ON_RESUME_TASKS_DELAY_MSEC);
  }
 else {
    Log.v(TAG,"String_Node_Str");
    onResumeTasks();
  }
  mHandler.post(new Runnable(){
    @Override public void run(){
      mActivity.updateStorageSpaceAndHint();
      updateRemainingPhotos();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onResumeAfterSuper(){
  mLastPhotoTakenWithRefocus=false;
  String action=mActivity.getIntent().getAction();
  if (MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA.equals(action) || MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action)) {
    Log.v(TAG,"String_Node_Str");
    mHandler.postDelayed(new Runnable(){
      public void run(){
        onResumeTasks();
      }
    }
,ON_RESUME_TASKS_DELAY_MSEC);
  }
 else {
    Log.v(TAG,"String_Node_Str");
    onResumeTasks();
  }
  if (mSoundPool == null) {
    mSoundPool=new SoundPool(1,AudioManager.STREAM_NOTIFICATION,0);
    mRefocusSound=mSoundPool.load(mActivity,R.raw.camera_click_x5,1);
  }
  mHandler.post(new Runnable(){
    @Override public void run(){
      mActivity.updateStorageSpaceAndHint();
      updateRemainingPhotos();
    }
  }
);
}
Program: 38233
Project: 38233
Buggy source:
@Override public void onPauseBeforeSuper(){
  mPaused=true;
  Sensor gsensor=mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
  if (gsensor != null) {
    mSensorManager.unregisterListener(this,gsensor);
  }
  Sensor msensor=mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
  if (msensor != null) {
    mSensorManager.unregisterListener(this,msensor);
  }
  Log.d(TAG,"String_Node_Str");
  removeIdleHandler();
}

Fixed version (ground truth):
@Override public void onPauseBeforeSuper(){
  mPaused=true;
  Sensor gsensor=mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
  if (gsensor != null) {
    mSensorManager.unregisterListener(this,gsensor);
  }
  Sensor msensor=mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
  if (msensor != null) {
    mSensorManager.unregisterListener(this,msensor);
  }
  if (mSoundPool != null) {
    mSoundPool.release();
    mSoundPool=null;
  }
  Log.d(TAG,"String_Node_Str");
  removeIdleHandler();
}
Program: 38234
Project: 38234
Buggy source:
public CountDownView(Context context,AttributeSet attrs){
  super(context,attrs);
  mContext=context;
  mCountDownAnim=AnimationUtils.loadAnimation(context,R.anim.count_down_exit);
  if (context.getResources().getBoolean(R.bool.force_count_down_sound)) {
    mSoundPool=new SoundPool(1,AudioManager.STREAM_SYSTEM_ENFORCED,0);
  }
 else {
    mSoundPool=new SoundPool(1,AudioManager.STREAM_NOTIFICATION,0);
  }
  mBeepOnce=mSoundPool.load(context,R.raw.beep_once,1);
  mBeepTwice=mSoundPool.load(context,R.raw.beep_twice,1);
}

Fixed version (ground truth):
public CountDownView(Context context,AttributeSet attrs){
  super(context,attrs);
  mContext=context;
  mCountDownAnim=AnimationUtils.loadAnimation(context,R.anim.count_down_exit);
  if (mSoundPool == null) {
    if (context.getResources().getBoolean(R.bool.force_count_down_sound)) {
      mSoundPool=new SoundPool(1,AudioManager.STREAM_SYSTEM_ENFORCED,0);
    }
 else {
      mSoundPool=new SoundPool(1,AudioManager.STREAM_NOTIFICATION,0);
    }
    mBeepOnce=mSoundPool.load(context,R.raw.beep_once,1);
    mBeepTwice=mSoundPool.load(context,R.raw.beep_twice,1);
  }
}
Program: 38235
Project: 38235
Buggy source:
@Override public void onResumeAfterSuper(){
  mLastPhotoTakenWithRefocus=false;
  String action=mActivity.getIntent().getAction();
  if (MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA.equals(action) || MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action)) {
    Log.v(TAG,"String_Node_Str");
    mHandler.postDelayed(new Runnable(){
      public void run(){
        onResumeTasks();
      }
    }
,ON_RESUME_TASKS_DELAY_MSEC);
  }
 else {
    Log.v(TAG,"String_Node_Str");
    onResumeTasks();
  }
  mHandler.post(new Runnable(){
    @Override public void run(){
      mActivity.updateStorageSpaceAndHint();
      updateRemainingPhotos();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onResumeAfterSuper(){
  mLastPhotoTakenWithRefocus=false;
  String action=mActivity.getIntent().getAction();
  if (MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA.equals(action) || MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action)) {
    Log.v(TAG,"String_Node_Str");
    mHandler.postDelayed(new Runnable(){
      public void run(){
        onResumeTasks();
      }
    }
,ON_RESUME_TASKS_DELAY_MSEC);
  }
 else {
    Log.v(TAG,"String_Node_Str");
    onResumeTasks();
  }
  if (mSoundPool == null) {
    mSoundPool=new SoundPool(1,AudioManager.STREAM_NOTIFICATION,0);
    mRefocusSound=mSoundPool.load(mActivity,R.raw.camera_click_x5,1);
  }
  mHandler.post(new Runnable(){
    @Override public void run(){
      mActivity.updateStorageSpaceAndHint();
      updateRemainingPhotos();
    }
  }
);
}
Program: 38237
Project: 38237
Buggy source:
@Override public void onPauseBeforeSuper(){
  mPaused=true;
  Sensor gsensor=mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
  if (gsensor != null) {
    mSensorManager.unregisterListener(this,gsensor);
  }
  Sensor msensor=mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
  if (msensor != null) {
    mSensorManager.unregisterListener(this,msensor);
  }
  Log.d(TAG,"String_Node_Str");
  removeIdleHandler();
}

Fixed version (ground truth):
@Override public void onPauseBeforeSuper(){
  mPaused=true;
  Sensor gsensor=mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
  if (gsensor != null) {
    mSensorManager.unregisterListener(this,gsensor);
  }
  Sensor msensor=mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
  if (msensor != null) {
    mSensorManager.unregisterListener(this,msensor);
  }
  if (mSoundPool != null) {
    mSoundPool.release();
    mSoundPool=null;
  }
  Log.d(TAG,"String_Node_Str");
  removeIdleHandler();
}