Program: 15374
Project: 15374
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  if (item.getTitle().equals(getString(R.string.comment_edit_save))) {
    final ProgressDialog progressDialog=new ProgressDialog(this);
    progressDialog.setTitle(getString(R.string.comment_reply_submitting_title));
    progressDialog.setMessage(getString(R.string.comment_reply_submitting_message));
    progressDialog.setIndeterminate(true);
    progressDialog.setCancelable(true);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener(){
      public void onCancel(      final DialogInterface dialogInterface){
        General.quickToast(CommentEditActivity.this,R.string.comment_reply_oncancel);
        progressDialog.dismiss();
      }
    }
);
    progressDialog.setOnKeyListener(new DialogInterface.OnKeyListener(){
      public boolean onKey(      final DialogInterface dialogInterface,      final int keyCode,      final KeyEvent keyEvent){
        if (keyCode == KeyEvent.KEYCODE_BACK) {
          General.quickToast(CommentEditActivity.this,R.string.comment_reply_oncancel);
          progressDialog.dismiss();
        }
        return true;
      }
    }
);
    final APIResponseHandler.ActionResponseHandler handler=new APIResponseHandler.ActionResponseHandler(this){
      @Override protected void onSuccess(){
        General.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            if (progressDialog.isShowing())             progressDialog.dismiss();
            General.quickToast(CommentEditActivity.this,R.string.comment_edit_done);
            finish();
          }
        }
);
      }
      @Override protected void onCallbackException(      Throwable t){
        BugReportActivity.handleGlobalError(CommentEditActivity.this,t);
      }
      @Override protected void onFailure(      RequestFailureType type,      Throwable t,      StatusLine status,      String readableMessage){
        final RRError error=General.getGeneralErrorForFailure(context,type,t,status,null);
        General.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            General.showResultDialog(CommentEditActivity.this,error);
            if (progressDialog.isShowing())             progressDialog.dismiss();
          }
        }
);
      }
      @Override protected void onFailure(      final APIFailureType type){
        final RRError error=General.getGeneralErrorForFailure(context,type);
        General.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            General.showResultDialog(CommentEditActivity.this,error);
            if (progressDialog.isShowing())             progressDialog.dismiss();
          }
        }
);
      }
    }
;
    final CacheManager cm=CacheManager.getInstance(this);
    final RedditAccount selectedAccount=RedditAccountManager.getInstance(this).getDefaultAccount();
    RedditAPI.editComment(cm,handler,selectedAccount,commentIdAndType,textEdit.getText().toString(),this);
    progressDialog.show();
  }
 else   if (item.getTitle().equals(getString(R.string.comment_reply_preview))) {
    MarkdownPreviewDialog.newInstance(textEdit.getText().toString()).show(getFragmentManager(),"String_Node_Str");
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  if (item.getTitle().equals(getString(R.string.comment_edit_save))) {
    final ProgressDialog progressDialog=new ProgressDialog(this);
    progressDialog.setTitle(getString(R.string.comment_reply_submitting_title));
    progressDialog.setMessage(getString(R.string.comment_reply_submitting_message));
    progressDialog.setIndeterminate(true);
    progressDialog.setCancelable(true);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener(){
      public void onCancel(      final DialogInterface dialogInterface){
        General.quickToast(CommentEditActivity.this,R.string.comment_reply_oncancel);
        progressDialog.dismiss();
      }
    }
);
    progressDialog.setOnKeyListener(new DialogInterface.OnKeyListener(){
      public boolean onKey(      final DialogInterface dialogInterface,      final int keyCode,      final KeyEvent keyEvent){
        if (keyCode == KeyEvent.KEYCODE_BACK) {
          General.quickToast(CommentEditActivity.this,R.string.comment_reply_oncancel);
          progressDialog.dismiss();
        }
        return true;
      }
    }
);
    final APIResponseHandler.ActionResponseHandler handler=new APIResponseHandler.ActionResponseHandler(this){
      @Override protected void onSuccess(){
        AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            if (progressDialog.isShowing())             progressDialog.dismiss();
            General.quickToast(CommentEditActivity.this,R.string.comment_edit_done);
            finish();
          }
        }
);
      }
      @Override protected void onCallbackException(      Throwable t){
        BugReportActivity.handleGlobalError(CommentEditActivity.this,t);
      }
      @Override protected void onFailure(      RequestFailureType type,      Throwable t,      StatusLine status,      String readableMessage){
        final RRError error=General.getGeneralErrorForFailure(context,type,t,status,null);
        AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            General.showResultDialog(CommentEditActivity.this,error);
            if (progressDialog.isShowing())             progressDialog.dismiss();
          }
        }
);
      }
      @Override protected void onFailure(      final APIFailureType type){
        final RRError error=General.getGeneralErrorForFailure(context,type);
        AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            General.showResultDialog(CommentEditActivity.this,error);
            if (progressDialog.isShowing())             progressDialog.dismiss();
          }
        }
);
      }
    }
;
    final CacheManager cm=CacheManager.getInstance(this);
    final RedditAccount selectedAccount=RedditAccountManager.getInstance(this).getDefaultAccount();
    RedditAPI.editComment(cm,handler,selectedAccount,commentIdAndType,textEdit.getText().toString(),this);
    progressDialog.show();
  }
 else   if (item.getTitle().equals(getString(R.string.comment_reply_preview))) {
    MarkdownPreviewDialog.newInstance(textEdit.getText().toString()).show(getFragmentManager(),"String_Node_Str");
  }
  return true;
}