nus-yam/ex-repair huggingface dataset:
Program: 34096
Project: 34096
Buggy source:
private void setCameraForPlaying(EvercamCamera evercamCamera){
  try {
    VideoActivity.evercamCamera=evercamCamera;
    showImagesVideo=false;
    downloadStartCount=0;
    downloadEndCount=0;
    isProgressShowing=false;
    startDownloading=false;
    latestStartImageTime=0;
    successiveFailureCount=0;
    isShowingFailureMessage=false;
    optionsActivityStarted=false;
    mediaPlayerView.setVisibility(View.GONE);
    snapshotMenuView.setVisibility(View.GONE);
    paused=false;
    end=false;
    surfaceView.setVisibility(View.GONE);
    imageView.setVisibility(View.VISIBLE);
    showProgressView();
    loadImageFromCache(evercamCamera.getCameraId());
    if (!evercamCamera.isOffline()) {
      startDownloading=true;
    }
    showProgressView();
    mrlPlaying=evercamCamera.getExternalRtspUrl();
    mediaUrls=new ArrayList<>();
    mrlIndex=-1;
    if (mrlPlaying != null) {
      addUrlIfValid(mrlPlaying);
      mrlIndex=0;
      mrlPlaying=null;
    }
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
    BugSenseHandler.sendException(e);
    EvercamPlayApplication.sendCaughtException(this,e);
    CustomedDialog.showUnexpectedErrorDialog(VideoActivity.this);
  }
}

Fixed version (ground truth):
private void setCameraForPlaying(EvercamCamera evercamCamera){
  try {
    VideoActivity.evercamCamera=evercamCamera;
    showImagesVideo=false;
    downloadStartCount=0;
    downloadEndCount=0;
    isProgressShowing=false;
    startDownloading=false;
    latestStartImageTime=0;
    successiveFailureCount=0;
    isShowingFailureMessage=false;
    optionsActivityStarted=false;
    mediaPlayerView.setVisibility(View.GONE);
    snapshotMenuView.setVisibility(View.GONE);
    paused=false;
    end=false;
    surfaceView.setVisibility(View.GONE);
    imageView.setVisibility(View.VISIBLE);
    showProgressView();
    loadImageFromCache(VideoActivity.evercamCamera.getCameraId());
    if (!evercamCamera.isOffline()) {
      startDownloading=true;
    }
    showProgressView();
    mrlPlaying=evercamCamera.getExternalRtspUrl();
    mediaUrls=new ArrayList<>();
    mrlIndex=-1;
    if (mrlPlaying != null) {
      addUrlIfValid(mrlPlaying);
      mrlIndex=0;
      mrlPlaying=null;
    }
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
    BugSenseHandler.sendException(e);
    EvercamPlayApplication.sendCaughtException(this,e);
    CustomedDialog.showUnexpectedErrorDialog(VideoActivity.this);
  }
}
Program: 34097
Project: 34097
Buggy source:
private void setlayoutForLatestImageReceived(){
  if (cameraRelativeLayout.indexOfChild(loadingAnimation) >= 0) {
    loadingAnimation.setVisibility(View.GONE);
    cameraRelativeLayout.removeView(loadingAnimation);
  }
 else {
    greyImageShown();
    gradientLayout.showOfflineImage(true);
    offlineImage.setVisibility(View.INVISIBLE);
  }
  gradientLayout.removeGradientShadow();
  handler.removeCallbacks(LoadImageRunnable);
}

Fixed version (ground truth):
private void setlayoutForLatestImageReceived(){
  if (cameraRelativeLayout.indexOfChild(loadingAnimation) >= 0) {
    loadingAnimation.setVisibility(View.GONE);
    cameraRelativeLayout.removeView(loadingAnimation);
  }
  if (!evercamCamera.isActive()) {
    greyImageShown();
    gradientLayout.showOfflineImage(true);
    offlineImage.setVisibility(View.INVISIBLE);
  }
  gradientLayout.removeGradientShadow();
  handler.removeCallbacks(LoadImageRunnable);
}
Program: 34099
Project: 34099
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (Constants.isAppTrackingEnabled) {
    BugSenseHandler.initAndStartSession(this,Constants.bugsense_ApiKey);
  }
  EvercamPlayApplication.sendScreenAnalytics(this,getString(R.string.screen_camera_list));
  if (this.getActionBar() != null) {
    this.getActionBar().setHomeButtonEnabled(true);
    this.getActionBar().setDisplayShowTitleEnabled(false);
    this.getActionBar().setIcon(R.drawable.evercam_play_192x192);
  }
  setContentView(R.layout.camslayoutwithslide);
  activity=this;
  checkUser();
  new Handler().postDelayed(new Runnable(){
    @Override public void run(){
      addAllCameraViews(false,false);
    }
  }
,500);
  new CamerasCheckInternetTask(CamerasActivity.this,InternetCheckType.START).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (Constants.isAppTrackingEnabled) {
    BugSenseHandler.initAndStartSession(this,Constants.bugsense_ApiKey);
  }
  EvercamPlayApplication.sendScreenAnalytics(this,getString(R.string.screen_camera_list));
  if (this.getActionBar() != null) {
    this.getActionBar().setHomeButtonEnabled(true);
    this.getActionBar().setDisplayShowTitleEnabled(false);
    this.getActionBar().setIcon(R.drawable.evercam_play_192x192);
  }
  setContentView(R.layout.camslayoutwithslide);
  activity=this;
  checkUser();
  new Handler().postDelayed(new Runnable(){
    @Override public void run(){
      io.evercam.androidapp.custom.FlowLayout camsLineView=(io.evercam.androidapp.custom.FlowLayout)CamerasActivity.this.findViewById(R.id.cameras_flow_layout);
      if (!(camsLineView.getChildCount() > 0)) {
        addAllCameraViews(false,false);
      }
    }
  }
,500);
  new CamerasCheckInternetTask(CamerasActivity.this,InternetCheckType.START).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Program: 34100
Project: 34100
Buggy source:
public void updateTitleIfdifferent(){
  for (  EvercamCamera camera : AppData.evercamCameraList) {
    if (evercamCamera.getCameraId().equals(camera.getCameraId())) {
      titleText.setText(camera.getName());
    }
  }
}

Fixed version (ground truth):
public void updateTitleIfdifferent(){
  for (  EvercamCamera camera : AppData.evercamCameraList) {
    if (evercamCamera.getCameraId().equals(camera.getCameraId())) {
      gradientLayout.setTitle(camera.getName());
    }
  }
}
Program: 34101
Project: 34101
Buggy source:
public DeleteCameraTask(String cameraId,Activity activity){
  this.cameraId=cameraId;
  this.activity=activity;
}

Fixed version (ground truth):
public DeleteCameraTask(String cameraId,Activity activity,DeleteType type){
  this.cameraId=cameraId;
  this.activity=activity;
}
Program: 34102
Project: 34102
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  try {
switch (item.getItemId()) {
case R.id.video_menu_delete_camera:
      CustomedDialog.getConfirmRemoveDialog(VideoActivity.this,new DialogInterface.OnClickListener(){
        @Override public void onClick(        DialogInterface warningDialog,        int which){
          new DeleteCameraTask(evercamCamera.getCameraId(),VideoActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
        }
      }
,R.string.msg_confirm_remove_camera).show();
    return true;
case R.id.video_menu_view_camera:
  editStarted=true;
Intent viewIntent=new Intent(VideoActivity.this,ViewCameraActivity.class);
startActivityForResult(viewIntent,Constants.REQUEST_CODE_VIEW_CAMERA);
return true;
case R.id.video_menu_edit_camera:
editStarted=true;
Intent editIntent=new Intent(VideoActivity.this,AddEditCameraActivity.class);
editIntent.putExtra(Constants.KEY_IS_EDIT,true);
startActivityForResult(editIntent,Constants.REQUEST_CODE_PATCH_CAMERA);
return true;
case android.R.id.home:
this.finish();
return true;
default :
return true;
}
}
 catch (OutOfMemoryError e) {
Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
return true;
}
catch (Exception e) {
Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
if (Constants.isAppTrackingEnabled) {
BugSenseHandler.sendException(e);
}
return true;
}
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  try {
switch (item.getItemId()) {
case R.id.video_menu_delete_camera:
      CustomedDialog.getConfirmRemoveDialog(VideoActivity.this,new DialogInterface.OnClickListener(){
        @Override public void onClick(        DialogInterface warningDialog,        int which){
          new DeleteCameraTask(evercamCamera.getCameraId(),VideoActivity.this,DeleteType.DELETE_OWNED).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
        }
      }
,R.string.msg_confirm_remove_camera).show();
    return true;
case R.id.video_menu_view_camera:
  editStarted=true;
Intent viewIntent=new Intent(VideoActivity.this,ViewCameraActivity.class);
startActivityForResult(viewIntent,Constants.REQUEST_CODE_VIEW_CAMERA);
return true;
case R.id.video_menu_edit_camera:
editStarted=true;
Intent editIntent=new Intent(VideoActivity.this,AddEditCameraActivity.class);
editIntent.putExtra(Constants.KEY_IS_EDIT,true);
startActivityForResult(editIntent,Constants.REQUEST_CODE_PATCH_CAMERA);
return true;
case android.R.id.home:
this.finish();
return true;
default :
return true;
}
}
 catch (OutOfMemoryError e) {
Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
return true;
}
catch (Exception e) {
Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
if (Constants.isAppTrackingEnabled) {
BugSenseHandler.sendException(e);
}
return true;
}
}
Program: 34104
Project: 34104
Buggy source:
private EvercamCamera createCamera(CameraDetail detail){
  try {
    Camera.create(detail);
    Camera camera=Camera.getById(detail.getId(),false);
    EvercamCamera evercamCamera=new EvercamCamera().convertFromEvercam(camera);
    if (isReachableExternally || isReachableInternally) {
      evercamCamera.setStatus(CameraStatus.ACTIVE);
    }
    DbCamera dbCamera=new DbCamera(activity);
    dbCamera.addCamera(evercamCamera);
    AppData.evercamCameraList.add(evercamCamera);
    return evercamCamera;
  }
 catch (  EvercamException e) {
    errorMessage=e.getMessage();
    Log.e(TAG,"String_Node_Str" + e.getMessage());
    return null;
  }
}

Fixed version (ground truth):
private EvercamCamera createCamera(CameraDetail detail){
  try {
    Camera camera=Camera.create(detail);
    EvercamCamera evercamCamera=new EvercamCamera().convertFromEvercam(camera);
    if (isReachableExternally || isReachableInternally) {
      evercamCamera.setStatus(CameraStatus.ACTIVE);
    }
    DbCamera dbCamera=new DbCamera(activity);
    dbCamera.addCamera(evercamCamera);
    AppData.evercamCameraList.add(evercamCamera);
    return evercamCamera;
  }
 catch (  EvercamException e) {
    errorMessage=e.getMessage();
    Log.e(TAG,"String_Node_Str" + e.getMessage());
    return null;
  }
}
Program: 34105
Project: 34105
Buggy source:
private EvercamCamera patchCamera(CameraDetail detail){
  try {
    Camera patchedCamera=Camera.patch(detail);
    if (patchedCamera != null) {
      Camera camera=Camera.getById(detail.getId(),false);
      EvercamCamera evercamCamera=new EvercamCamera().convertFromEvercam(camera);
      DbCamera dbCamera=new DbCamera(activity);
      dbCamera.deleteCamera(evercamCamera.getCameraId());
      for (int index=0; index < AppData.evercamCameraList.size(); index++) {
        if (AppData.evercamCameraList.get(index).getCameraId().equals(camera.getId())) {
          AppData.evercamCameraList.remove(index);
        }
      }
      dbCamera.addCamera(evercamCamera);
      AppData.evercamCameraList.add(evercamCamera);
      return evercamCamera;
    }
 else {
      Log.e(TAG,"String_Node_Str");
      return null;
    }
  }
 catch (  EvercamException e) {
    errorMessage=e.getMessage();
    Log.e(TAG,"String_Node_Str" + e.getMessage());
    return null;
  }
}

Fixed version (ground truth):
private EvercamCamera patchCamera(CameraDetail detail){
  try {
    Camera patchedCamera=Camera.patch(detail);
    if (patchedCamera != null) {
      Camera camera=patchedCamera;
      EvercamCamera evercamCamera=new EvercamCamera().convertFromEvercam(camera);
      DbCamera dbCamera=new DbCamera(activity);
      dbCamera.deleteCamera(evercamCamera.getCameraId());
      for (int index=0; index < AppData.evercamCameraList.size(); index++) {
        if (AppData.evercamCameraList.get(index).getCameraId().equals(camera.getId())) {
          AppData.evercamCameraList.remove(index);
        }
      }
      dbCamera.addCamera(evercamCamera);
      AppData.evercamCameraList.add(evercamCamera);
      return evercamCamera;
    }
 else {
      Log.e(TAG,"String_Node_Str");
      return null;
    }
  }
 catch (  EvercamException e) {
    errorMessage=e.getMessage();
    Log.e(TAG,"String_Node_Str" + e.getMessage());
    return null;
  }
}
Program: 34106
Project: 34106
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.menurefresh:
    EvercamPlayApplication.sendEventAnalytics(this,R.string.category_menu,R.string.action_refresh,R.string.label_list_refresh);
  if (refresh != null)   refresh.setActionView(R.layout.actionbar_indeterminate_progress);
startCameraLoadingTask();
return true;
case R.id.menu_add_camera:
showAddCameraOptionsDialog();
return true;
case R.id.menu_settings:
EvercamPlayApplication.sendEventAnalytics(this,R.string.category_menu,R.string.action_settings,R.string.label_settings);
startActivity(new Intent(CamerasActivity.this,CameraPrefsActivity.class));
return true;
case R.id.menu_manage_accounts:
EvercamPlayApplication.sendEventAnalytics(this,R.string.category_menu,R.string.action_manage_account,R.string.label_account);
startActivityForResult(new Intent(CamerasActivity.this,ManageAccountsActivity.class),Constants.REQUEST_CODE_MANAGE_ACCOUNT);
stopImageLoading=true;
return true;
case R.id.menu_about:
EvercamPlayApplication.sendEventAnalytics(this,R.string.category_menu,R.string.action_about,R.string.label_about);
startActivity(new Intent(CamerasActivity.this,AboutDialog.class));
return true;
case R.id.menu_logout:
showSignOutDialog();
return true;
default :
return super.onOptionsItemSelected(item);
}
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.menurefresh:
    EvercamPlayApplication.sendEventAnalytics(this,R.string.category_menu,R.string.action_refresh,R.string.label_list_refresh);
  if (refresh != null)   refresh.setActionView(R.layout.actionbar_indeterminate_progress);
startCameraLoadingTask();
return true;
case R.id.menu_add_camera:
showAddCameraOptionsDialog();
return true;
case R.id.menu_settings:
EvercamPlayApplication.sendEventAnalytics(this,R.string.category_menu,R.string.action_settings,R.string.label_settings);
startActivity(new Intent(CamerasActivity.this,CameraPrefsActivity.class));
return true;
case R.id.menu_manage_accounts:
EvercamPlayApplication.sendEventAnalytics(this,R.string.category_menu,R.string.action_manage_account,R.string.label_account);
startActivityForResult(new Intent(CamerasActivity.this,ManageAccountsActivity.class),Constants.REQUEST_CODE_MANAGE_ACCOUNT);
return true;
case R.id.menu_about:
EvercamPlayApplication.sendEventAnalytics(this,R.string.category_menu,R.string.action_about,R.string.label_about);
startActivity(new Intent(CamerasActivity.this,AboutDialog.class));
return true;
case R.id.menu_logout:
showSignOutDialog();
return true;
default :
return super.onOptionsItemSelected(item);
}
}
Program: 34107
Project: 34107
Buggy source:
private void startLoadingCameras(){
  stopImageLoading=false;
  reloadProgressDialog=new CustomProgressDialog(this);
  if (reloadCameraList) {
    reloadProgressDialog.show(getString(R.string.loading_cameras));
  }
  startCameraLoadingTask();
}

Fixed version (ground truth):
private void startLoadingCameras(){
  reloadProgressDialog=new CustomProgressDialog(this);
  if (reloadCameraList) {
    reloadProgressDialog.show(getString(R.string.loading_cameras));
  }
  startCameraLoadingTask();
}
Program: 34108
Project: 34108
Buggy source:
/** 
 * Return bounds with bottom value + 300 in order to load more cameras
 */
private Rect readLiveBoundsOfScrollView(){
  Rect scrollViewBounds=new Rect();
  CustomScrollView scrollView=(CustomScrollView)CamerasActivity.this.findViewById(R.id.cameras_scroll_view);
  scrollView.getDrawingRect(scrollViewBounds);
  Log.d(TAG,scrollViewBounds.top + "String_Node_Str" + scrollViewBounds.bottom+ "String_Node_Str"+ scrollViewBounds.left+ "String_Node_Str"+ scrollViewBounds.right);
  Rect rectWithExtension=new Rect(scrollViewBounds.left,scrollViewBounds.top,scrollViewBounds.right,scrollViewBounds.bottom + 300);
  Log.d(TAG,"String_Node_Str" + rectWithExtension.top + "String_Node_Str"+ rectWithExtension.bottom+ "String_Node_Str"+ rectWithExtension.left+ "String_Node_Str"+ rectWithExtension.right);
  return rectWithExtension;
}

Fixed version (ground truth):
private Rect readLiveBoundsOfScrollView(){
  CustomScrollView scrollView=(CustomScrollView)CamerasActivity.this.findViewById(R.id.cameras_scroll_view);
  return scrollView.getLiveBoundsRect();
}
Program: 34109
Project: 34109
Buggy source:
@Override public void run(){
  try {
    if (end)     return;
    if (CamerasActivity.stopImageLoading) {
      return;
    }
    if (evercamCamera.loadingStatus == ImageLoadingStatus.not_started) {
      liveImageTask=new DownloadLiveImageTask();
      liveImageTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }
 else     if (evercamCamera.loadingStatus == ImageLoadingStatus.live_received) {
      setlayoutForLiveImageReceived();
      return;
    }
 else     if (evercamCamera.loadingStatus == ImageLoadingStatus.live_not_received) {
      latestTask=new DownloadLatestTask(evercamCamera.getCameraId(),CameraLayout.this);
      latestTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      setlayoutForNoImageReceived();
    }
 else     if (evercamCamera.loadingStatus == ImageLoadingStatus.camba_image_received) {
      setlayoutForLatestImageReceived();
      return;
    }
 else     if (evercamCamera.loadingStatus == ImageLoadingStatus.camba_not_received) {
      setlayoutForNoImageReceived();
    }
  }
 catch (  OutOfMemoryError e) {
    Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
    handler.postDelayed(LoadImageRunnable,5000);
    return;
  }
catch (  Exception e) {
    Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
    if (!end) {
      handler.postDelayed(LoadImageRunnable,5000);
    }
    if (Constants.isAppTrackingEnabled) {
      BugSenseHandler.sendException(e);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    if (end)     return;
    if (evercamCamera.loadingStatus == ImageLoadingStatus.not_started) {
      liveImageTask=new DownloadLiveImageTask();
      liveImageTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }
 else     if (evercamCamera.loadingStatus == ImageLoadingStatus.live_received) {
      setlayoutForLiveImageReceived();
      return;
    }
 else     if (evercamCamera.loadingStatus == ImageLoadingStatus.live_not_received) {
      latestTask=new DownloadLatestTask(evercamCamera.getCameraId(),CameraLayout.this);
      latestTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
      setlayoutForNoImageReceived();
    }
 else     if (evercamCamera.loadingStatus == ImageLoadingStatus.camba_image_received) {
      setlayoutForLatestImageReceived();
      return;
    }
 else     if (evercamCamera.loadingStatus == ImageLoadingStatus.camba_not_received) {
      setlayoutForNoImageReceived();
    }
  }
 catch (  OutOfMemoryError e) {
    Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
    handler.postDelayed(LoadImageRunnable,5000);
    return;
  }
catch (  Exception e) {
    Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
    if (!end) {
      handler.postDelayed(LoadImageRunnable,5000);
    }
    if (Constants.isAppTrackingEnabled) {
      BugSenseHandler.sendException(e);
    }
  }
}
Program: 34110
Project: 34110
Buggy source:
public void loadImage(){
  isImageLoadedFromCache=loadImageFromCache();
  if (!end) {
    handler.postDelayed(LoadImageRunnable,0);
  }
}

Fixed version (ground truth):
public void loadImage(){
  if (!end) {
    handler.postDelayed(LoadImageRunnable,0);
  }
}
Program: 34112
Project: 34112
Buggy source:
private void showThumbnail(){
  Drawable thumbnail=getThumbnailFromCamera(evercamCamera);
  if (thumbnail != null) {
    loadingAnimation.setVisibility(View.GONE);
    cameraRelativeLayout.removeView(loadingAnimation);
    cameraRelativeLayout.setBackgroundDrawable(thumbnail);
  }
}

Fixed version (ground truth):
private boolean showThumbnail(){
  Drawable thumbnail=getThumbnailFromCamera(evercamCamera);
  if (thumbnail != null) {
    loadingAnimation.setVisibility(View.GONE);
    cameraRelativeLayout.removeView(loadingAnimation);
    cameraRelativeLayout.setBackgroundDrawable(thumbnail);
    return true;
  }
  return false;
}
Program: 34113
Project: 34113
Buggy source:
public CustomScrollView(Context context,AttributeSet attrs){
  super(context,attrs);
  scrollerTask=new Runnable(){
    public void run(){
      int newPosition=getScrollY();
      if (initialPosition - newPosition == 0) {
        if (onScrollStoppedListener != null) {
          onScrollStoppedListener.onScrollStopped();
        }
      }
 else {
        initialPosition=getScrollY();
        CustomScrollView.this.postDelayed(scrollerTask,newCheck);
      }
    }
  }
;
}

Fixed version (ground truth):
public CustomScrollView(Context context,AttributeSet attrs){
  super(context,attrs);
  scrollerTask=new Runnable(){
    public void run(){
      int newPosition=getScrollY();
      if (initialPosition - newPosition == 0) {
        if (onScrollStoppedListener != null) {
          onScrollStoppedListener.onScrollStopped();
        }
      }
 else {
        initialPosition=getScrollY();
        CustomScrollView.this.postDelayed(scrollerTask,100);
      }
    }
  }
;
}
Program: 34114
Project: 34114
Buggy source:
public void run(){
  int newPosition=getScrollY();
  if (initialPosition - newPosition == 0) {
    if (onScrollStoppedListener != null) {
      onScrollStoppedListener.onScrollStopped();
    }
  }
 else {
    initialPosition=getScrollY();
    CustomScrollView.this.postDelayed(scrollerTask,newCheck);
  }
}

Fixed version (ground truth):
public void run(){
  int newPosition=getScrollY();
  if (initialPosition - newPosition == 0) {
    if (onScrollStoppedListener != null) {
      onScrollStoppedListener.onScrollStopped();
    }
  }
 else {
    initialPosition=getScrollY();
    CustomScrollView.this.postDelayed(scrollerTask,100);
  }
}
Program: 34115
Project: 34115
Buggy source:
public void startScrollerTask(){
  initialPosition=getScrollY();
  CustomScrollView.this.postDelayed(scrollerTask,newCheck);
}

Fixed version (ground truth):
public void startScrollerTask(){
  initialPosition=getScrollY();
  CustomScrollView.this.postDelayed(scrollerTask,100);
}
Program: 34116
Project: 34116
Buggy source:
public MyPreferenceFragment(){
  super();
}

Fixed version (ground truth):
public MyPreferenceFragment(){
}
Program: 34118
Project: 34118
Buggy source:
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    if (type == InternetCheckType.START) {
      startLoadingCameras();
    }
 else     if (type == InternetCheckType.RESTART) {
      if (reloadCameraList) {
        removeAllCameraViews();
        startLoadingCameras();
        reloadCameraList=false;
      }
 else {
        int camsOldValue=camerasPerRow;
        SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(CamerasActivity.this);
        camerasPerRow=PrefsManager.getCameraPerRow(sharedPrefs,2);
        if (camsOldValue != camerasPerRow) {
          removeAllCameraViews();
          addAllCameraViews(false);
        }
      }
    }
  }
 else {
    CustomedDialog.showInternetNotConnectDialog(CamerasActivity.this);
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    if (type == InternetCheckType.START) {
      startLoadingCameras();
    }
 else     if (type == InternetCheckType.RESTART) {
      if (reloadCameraList) {
        removeAllCameraViews();
        startLoadingCameras();
        reloadCameraList=false;
      }
 else {
        int camsOldValue=camerasPerRow;
        camerasPerRow=recalculateCameraPerRow();
        if (camsOldValue != camerasPerRow) {
          removeAllCameraViews();
          addAllCameraViews(false);
        }
      }
    }
  }
 else {
    CustomedDialog.showInternetNotConnectDialog(CamerasActivity.this);
  }
}
Program: 34119
Project: 34119
Buggy source:
boolean resizeCameras(){
  try {
    int screen_width=readScreenWidth(this);
    io.evercam.androidapp.custom.FlowLayout camsLineView=(io.evercam.androidapp.custom.FlowLayout)this.findViewById(R.id.camsLV);
    for (int i=0; i < camsLineView.getChildCount(); i++) {
      LinearLayout pview=(LinearLayout)camsLineView.getChildAt(i);
      CameraLayout cameraLayout=(CameraLayout)pview.getChildAt(0);
      LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT,android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
      params.width=((i + 1 % camerasPerRow == 0) ? (screen_width - (i % camerasPerRow) * (screen_width / camerasPerRow)) : screen_width / camerasPerRow);
      params.height=(int)(params.width / (1.25));
      cameraLayout.setLayoutParams(params);
    }
    return true;
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
    if (Constants.isAppTrackingEnabled) {
      BugSenseHandler.sendException(e);
    }
    EvercamPlayApplication.sendEventAnalytics(this,R.string.category_error,R.string.action_error_camera_list,R.string.label_error_resize);
    EvercamPlayApplication.sendCaughtException(this,e);
    CustomedDialog.showUnexpectedErrorDialog(CamerasActivity.this);
  }
  return false;
}

Fixed version (ground truth):
boolean resizeCameras(){
  try {
    int screen_width=readScreenWidth(this);
    camerasPerRow=recalculateCameraPerRow();
    io.evercam.androidapp.custom.FlowLayout camsLineView=(io.evercam.androidapp.custom.FlowLayout)this.findViewById(R.id.camsLV);
    for (int i=0; i < camsLineView.getChildCount(); i++) {
      LinearLayout pview=(LinearLayout)camsLineView.getChildAt(i);
      CameraLayout cameraLayout=(CameraLayout)pview.getChildAt(0);
      LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT,android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
      params.width=((i + 1 % camerasPerRow == 0) ? (screen_width - (i % camerasPerRow) * (screen_width / camerasPerRow)) : screen_width / camerasPerRow);
      params.height=(int)(params.width / (1.25));
      cameraLayout.setLayoutParams(params);
    }
    return true;
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
    if (Constants.isAppTrackingEnabled) {
      BugSenseHandler.sendException(e);
    }
    EvercamPlayApplication.sendEventAnalytics(this,R.string.category_error,R.string.action_error_camera_list,R.string.label_error_resize);
    EvercamPlayApplication.sendCaughtException(this,e);
    CustomedDialog.showUnexpectedErrorDialog(CamerasActivity.this);
  }
  return false;
}
Program: 34120
Project: 34120
Buggy source:
@Override public void onConfigurationChanged(Configuration newConfig){
  try {
    super.onConfigurationChanged(newConfig);
    resizeCameras();
  }
 catch (  Exception e) {
    if (Constants.isAppTrackingEnabled)     BugSenseHandler.sendException(e);
  }
}

Fixed version (ground truth):
@Override public void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  resizeCameras();
}
Program: 34121
Project: 34121
Buggy source:
public static int getCameraPerRow(SharedPreferences sharedPrefs,int oldNumber){
  return Integer.parseInt(sharedPrefs.getString(KEY_CAMERA_PER_ROW,"String_Node_Str" + oldNumber));
}

Fixed version (ground truth):
public static int getCameraPerRow(Context context,int oldNumber){
  SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(context);
  return Integer.parseInt(sharedPrefs.getString(KEY_CAMERA_PER_ROW,"String_Node_Str" + oldNumber));
}
Program: 34122
Project: 34122
Buggy source:
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    if (type == InternetCheckType.START) {
      startLoadingCameras();
    }
 else     if (type == InternetCheckType.RESTART) {
      int camsOldValue=camerasPerRow;
      SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(CamerasActivity.this);
      camerasPerRow=PrefsManager.getCameraPerRow(sharedPrefs,2);
      if (camsOldValue != camerasPerRow) {
        removeAllCameraViews();
        addAllCameraViews(false);
      }
    }
  }
 else {
    CustomedDialog.showInternetNotConnectDialog(CamerasActivity.this);
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    if (type == InternetCheckType.START) {
      startLoadingCameras();
    }
 else     if (type == InternetCheckType.RESTART) {
      if (reloadCameraList) {
        removeAllCameraViews();
        startLoadingCameras();
        reloadCameraList=false;
      }
 else {
        int camsOldValue=camerasPerRow;
        SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(CamerasActivity.this);
        camerasPerRow=PrefsManager.getCameraPerRow(sharedPrefs,2);
        if (camsOldValue != camerasPerRow) {
          removeAllCameraViews();
          addAllCameraViews(false);
        }
      }
    }
  }
 else {
    CustomedDialog.showInternetNotConnectDialog(CamerasActivity.this);
  }
}
Program: 34123
Project: 34123
Buggy source:
@Override public void onRestart(){
  super.onRestart();
  if (reloadCameraList) {
    removeAllCameraViews();
    startLoadingCameras();
    reloadCameraList=false;
  }
 else {
    try {
      new CamerasCheckInternetTask(CamerasActivity.this,InternetCheckType.RESTART).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }
 catch (    RejectedExecutionException e) {
      EvercamPlayApplication.sendCaughtExceptionNotImportant(activity,e);
    }
  }
}

Fixed version (ground truth):
@Override public void onRestart(){
  super.onRestart();
  try {
    new CamerasCheckInternetTask(CamerasActivity.this,InternetCheckType.RESTART).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  }
 catch (  RejectedExecutionException e) {
    EvercamPlayApplication.sendCaughtExceptionNotImportant(activity,e);
  }
}
Program: 34124
Project: 34124
Buggy source:
private void logOutUser(){
  try {
    SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
    PrefsManager.removeUserEmail(sharedPrefs);
    DbAppUser dbUser=new DbAppUser(this);
    dbUser.deleteAppUserByEmail(AppData.defaultUser.getEmail());
    AppData.defaultUser=null;
    AppData.appUsers.clear();
    AppData.evercamCameraList.clear();
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str" + e.toString());
  }
  startActivity(new Intent(this,MainActivity.class));
}

Fixed version (ground truth):
private void logOutUser(){
  try {
    SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
    PrefsManager.removeUserEmail(sharedPrefs);
    DbAppUser dbUser=new DbAppUser(this);
    dbUser.deleteAppUserByEmail(AppData.defaultUser.getEmail());
    AppData.defaultUser=null;
    AppData.appUsers.clear();
    AppData.evercamCameraList.clear();
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str" + e.toString());
  }
  finish();
  startActivity(new Intent(this,SlideActivity.class));
}
Program: 34125
Project: 34125
Buggy source:
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    if (isUserLogged()) {
      startCamerasActivity();
    }
 else {
      Intent slideIntent=new Intent(MainActivity.this,SlideActivity.class);
      startActivity(slideIntent);
    }
  }
 else {
    CustomedDialog.showInternetNotConnectDialog(MainActivity.this);
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    if (isUserLogged()) {
      finish();
      startCamerasActivity();
    }
 else {
      finish();
      Intent slideIntent=new Intent(MainActivity.this,SlideActivity.class);
      startActivity(slideIntent);
    }
  }
 else {
    CustomedDialog.showInternetNotConnectDialog(MainActivity.this);
  }
}
Program: 34126
Project: 34126
Buggy source:
private void logOutUser(){
  try {
    SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
    PrefsManager.removeUserEmail(sharedPrefs);
    AppData.defaultUser=null;
    AppData.appUsers.clear();
    AppData.evercamCameraList.clear();
    DbAppUser dbUser=new DbAppUser(this);
    List<AppUser> list=dbUser.getAllAppUsers(10000);
    if (list != null && list.size() > 0) {
      for (      AppUser user : list) {
        dbUser.deleteAppUserByEmail(user.getEmail());
      }
    }
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str" + e.toString());
  }
  startActivity(new Intent(this,MainActivity.class));
}

Fixed version (ground truth):
private void logOutUser(){
  try {
    SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
    PrefsManager.removeUserEmail(sharedPrefs);
    DbAppUser dbUser=new DbAppUser(this);
    dbUser.deleteAppUserByEmail(AppData.defaultUser.getEmail());
    AppData.defaultUser=null;
    AppData.appUsers.clear();
    AppData.evercamCameraList.clear();
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str" + e.toString());
  }
  startActivity(new Intent(this,MainActivity.class));
}
Program: 34128
Project: 34128
Buggy source:
private void startLoadingCameras(){
  LoadCameraListTask loadTask=new LoadCameraListTask(AppData.defaultUser,CamerasActivity.this);
  loadTask.reload=true;
  loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

Fixed version (ground truth):
private void startLoadingCameras(){
  stopImageLoading=false;
  LoadCameraListTask loadTask=new LoadCameraListTask(AppData.defaultUser,CamerasActivity.this);
  loadTask.reload=true;
  loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Program: 34129
Project: 34129
Buggy source:
private void launchLogin(View view){
  boolean isDefault=false;
  EditText usernameEdit=(EditText)view.findViewById(R.id.username_edit);
  EditText passwordEdit=(EditText)view.findViewById(R.id.user_password);
  String username=usernameEdit.getText().toString();
  String password=passwordEdit.getText().toString();
  if (TextUtils.isEmpty(username)) {
    CustomToast.showInCenter(this,R.string.error_username_required);
    return;
  }
 else   if (username.contains("String_Node_Str")) {
    CustomToast.showInCenter(this,R.string.error_invalid_username);
    return;
  }
  if (TextUtils.isEmpty(password)) {
    CustomToast.showInCenter(this,R.string.error_password_required);
    return;
  }
 else   if (password.contains("String_Node_Str")) {
    CustomToast.showInCenter(this,R.string.error_invalid_password);
    return;
  }
  ProgressBar progressBar=(ProgressBar)alertDialog.findViewById(R.id.pb_loadinguser);
  progressBar.setVisibility(View.VISIBLE);
  AddAccountTask task=new AddAccountTask(username,password,isDefault,alertDialog);
  task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

Fixed version (ground truth):
private void launchLogin(View view){
  boolean isDefault=false;
  EditText usernameEdit=(EditText)view.findViewById(R.id.username_edit);
  EditText passwordEdit=(EditText)view.findViewById(R.id.user_password);
  String username=usernameEdit.getText().toString();
  String password=passwordEdit.getText().toString();
  if (TextUtils.isEmpty(username)) {
    CustomToast.showInCenter(this,R.string.error_username_required);
    return;
  }
 else   if (username.contains("String_Node_Str")) {
    CustomToast.showInCenter(this,R.string.error_invalid_username);
    return;
  }
  if (TextUtils.isEmpty(password)) {
    CustomToast.showInCenter(this,R.string.error_password_required);
    return;
  }
 else   if (password.contains("String_Node_Str")) {
    CustomToast.showInCenter(this,R.string.error_invalid_password);
    return;
  }
  AddAccountTask task=new AddAccountTask(username,password,isDefault,alertDialog);
  task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Program: 34130
Project: 34130
Buggy source:
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    launchLogin(dialogView);
  }
 else {
    CustomedDialog.showInternetNotConnectDialog(ManageAccountsActivity.this);
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    Log.d(TAG,"String_Node_Str");
    launchLogin(dialogView);
  }
 else {
    CustomedDialog.showInternetNotConnectDialog(ManageAccountsActivity.this);
  }
}
Program: 34132
Project: 34132
Buggy source:
@Override protected Drawable doInBackground(String... urls){
  for (  String url : urls) {
    try {
      ArrayList<Cookie> cookies=new ArrayList<Cookie>();
      Drawable drawable=null;
      if (evercamCamera.hasCredentials()) {
        if (!url.isEmpty()) {
          drawable=Commons.getDrawablefromUrlAuthenticated(url,evercamCamera.getUsername(),evercamCamera.getPassword(),cookies,3000);
        }
      }
 else {
        Camera camera=Camera.getById(evercamCamera.getCameraId());
        if (camera != null) {
          InputStream stream=camera.getSnapshotFromEvercam();
          drawable=Drawable.createFromStream(stream,"String_Node_Str");
        }
      }
      if (cookies.size() > 0) {
        evercamCamera.cookies=cookies;
      }
      return drawable;
    }
 catch (    OutOfMemoryError e) {
      Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
      return null;
    }
catch (    Exception e) {
      Log.e(TAG,"String_Node_Str" + e.getMessage());
    }
  }
  return null;
}

Fixed version (ground truth):
@Override protected Drawable doInBackground(String... urls){
  for (  String url : urls) {
    if (CamerasActivity.stopImageLoading) {
      this.cancel(true);
    }
    try {
      ArrayList<Cookie> cookies=new ArrayList<Cookie>();
      Drawable drawable=null;
      if (evercamCamera.hasCredentials()) {
        if (!url.isEmpty()) {
          drawable=Commons.getDrawablefromUrlAuthenticated(url,evercamCamera.getUsername(),evercamCamera.getPassword(),cookies,3000);
        }
      }
 else {
        Camera camera=Camera.getById(evercamCamera.getCameraId());
        if (camera != null) {
          InputStream stream=camera.getSnapshotFromEvercam();
          drawable=Drawable.createFromStream(stream,"String_Node_Str");
        }
      }
      if (cookies.size() > 0) {
        evercamCamera.cookies=cookies;
      }
      return drawable;
    }
 catch (    OutOfMemoryError e) {
      Log.e(TAG,e.toString() + "String_Node_Str" + Log.getStackTraceString(e));
      return null;
    }
catch (    Exception e) {
      Log.e(TAG,"String_Node_Str" + e.getMessage());
    }
  }
  return null;
}
Program: 34133
Project: 34133
Buggy source:
private void greyImageShown(){
  this.setBackgroundColor(Color.GRAY);
  cameraRelativeLayout.getBackground().setAlpha(70);
}

Fixed version (ground truth):
private void greyImageShown(){
  try {
    this.setBackgroundColor(Color.GRAY);
    cameraRelativeLayout.getBackground().setAlpha(70);
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str" + e.toString());
  }
}
Program: 34134
Project: 34134
Buggy source:
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    if (type == InternetCheckType.START) {
      startLoadingCameras();
    }
 else     if (type == InternetCheckType.RESTART) {
      try {
        if (isUsersAccountsActivityStarted) {
          isUsersAccountsActivityStarted=false;
          startLoadingCameras();
        }
        int camsOldValue=camerasPerRow;
        SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(CamerasActivity.this);
        camerasPerRow=PrefsManager.getCameraPerRow(sharedPrefs,2);
        if (camsOldValue != camerasPerRow) {
          removeAllCameraViews();
          addAllCameraViews(false);
        }
      }
 catch (      Exception e) {
        if (Constants.isAppTrackingEnabled)         BugSenseHandler.sendException(e);
      }
    }
  }
 else {
    showInternetNotConnectDialog();
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    if (type == InternetCheckType.START) {
      startLoadingCameras();
    }
 else     if (type == InternetCheckType.RESTART) {
      try {
        if (isUsersAccountsActivityStarted) {
          isUsersAccountsActivityStarted=false;
          startLoadingCameras();
        }
        int camsOldValue=camerasPerRow;
        SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(CamerasActivity.this);
        camerasPerRow=PrefsManager.getCameraPerRow(sharedPrefs,2);
        if (camsOldValue != camerasPerRow) {
          removeAllCameraViews();
          addAllCameraViews(false);
        }
      }
 catch (      Exception e) {
        if (Constants.isAppTrackingEnabled)         BugSenseHandler.sendException(e);
      }
    }
  }
 else {
    CustomedDialog.showInternetNotConnectDialog(CamerasActivity.this);
  }
}
Program: 34135
Project: 34135
Buggy source:
@Override public void onClick(DialogInterface dialog,int which){
  dialog.dismiss();
  finish();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  new LoginCheckInternetTask(LoginActivity.this,InternetCheckType.SIGNUP).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Program: 34136
Project: 34136
Buggy source:
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    if (type == InternetCheckType.LOGIN) {
      attemptLogin();
    }
 else     if (type == InternetCheckType.SIGNUP) {
      Intent signupIntent=new Intent(LoginActivity.this,SignUpActivity.class);
      startActivity(signupIntent);
    }
  }
 else {
    showInternetNotConnectDialog();
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Boolean hasNetwork){
  if (hasNetwork) {
    if (type == InternetCheckType.LOGIN) {
      attemptLogin();
    }
 else     if (type == InternetCheckType.SIGNUP) {
      Intent signupIntent=new Intent(LoginActivity.this,SignUpActivity.class);
      startActivity(signupIntent);
    }
  }
 else {
    CustomedDialog.showInternetNotConnectDialog(LoginActivity.this);
  }
}
Program: 34137
Project: 34137
Buggy source:
@Override protected void onPostExecute(Boolean hasNetwork){
  try {
    if (hasNetwork) {
      if (isUserLogged()) {
        startCamerasActivity();
      }
 else {
        Intent slideIntent=new Intent(MainActivity.this,SlideActivity.class);
        startActivity(slideIntent);
      }
    }
 else {
      showInternetNotConnectDialog();
    }
  }
 catch (  Exception e) {
    BugSenseHandler.sendException(e);
    CustomedDialog.getAlertDialog(MainActivity.this,"String_Node_Str",e.toString()).show();
    Log.e(TAG,Log.getStackTraceString(e));
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Boolean hasNetwork){
  try {
    if (hasNetwork) {
      if (isUserLogged()) {
        startCamerasActivity();
      }
 else {
        Intent slideIntent=new Intent(MainActivity.this,SlideActivity.class);
        startActivity(slideIntent);
      }
    }
 else {
      CustomedDialog.showInternetNotConnectDialog(MainActivity.this);
    }
  }
 catch (  Exception e) {
    BugSenseHandler.sendException(e);
    CustomedDialog.getAlertDialog(MainActivity.this,"String_Node_Str",e.toString()).show();
    Log.e(TAG,Log.getStackTraceString(e));
  }
}
Program: 34138
Project: 34138
Buggy source:
private void logOutUser(){
  try {
    SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
    PrefsManager.removeUserEmail(sharedPrefs);
    AppData.defaultUser=null;
    AppData.evercamCameraList.clear();
    DbAppUser dbUser=new DbAppUser(this);
    List<AppUser> list=dbUser.getAllAppUsers(10000);
    if (list != null && list.size() > 0) {
      for (      AppUser user : list) {
        dbUser.deleteAppUserByEmail(user.getEmail());
      }
    }
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str" + e.toString());
  }
  startActivity(new Intent(this,MainActivity.class));
}

Fixed version (ground truth):
private void logOutUser(){
  try {
    SharedPreferences sharedPrefs=PreferenceManager.getDefaultSharedPreferences(this);
    PrefsManager.removeUserEmail(sharedPrefs);
    AppData.defaultUser=null;
    AppData.appUsers.clear();
    AppData.evercamCameraList.clear();
    DbAppUser dbUser=new DbAppUser(this);
    List<AppUser> list=dbUser.getAllAppUsers(10000);
    if (list != null && list.size() > 0) {
      for (      AppUser user : list) {
        dbUser.deleteAppUserByEmail(user.getEmail());
      }
    }
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str" + e.toString());
  }
  startActivity(new Intent(this,MainActivity.class));
}
Program: 34141
Project: 34141
Buggy source:
private void restartPlay(String media){
  if (libvlc == null)   return;
  try {
    libvlc.stop();
    if (media.length() > 0) {
      showToast(getString(R.string.reconnecting) + media);
    }
    libvlc.getMediaList().clear();
    libvlc.playMRL(media);
  }
 catch (  Exception e) {
    Toast.makeText(this,"String_Node_Str" + media + "String_Node_Str"+ e.getMessage(),Toast.LENGTH_LONG).show();
  }
}

Fixed version (ground truth):
private void restartPlay(String media){
  if (libvlc == null)   return;
  try {
    libvlc.stop();
    if (media.length() > 0) {
      showToast(getString(R.string.reconnecting) + media);
    }
    libvlc.getMediaList().clear();
    libvlc.playMRL(media);
  }
 catch (  Exception e) {
    if (!isPlayingJpg) {
      Toast.makeText(this,"String_Node_Str" + media + "String_Node_Str"+ e.getMessage(),Toast.LENGTH_LONG).show();
    }
  }
}