Program: 13494
Project: 13494
Buggy source:
private void updateStatusViews(){
  if (!isAdded() || mComment == null) {
    return;
  }
  final int statusTextResId;
  final int statusColor;
  CommentStatus commentStatus=CommentStatus.fromString(mComment.getStatus());
switch (commentStatus) {
case APPROVED:
    statusTextResId=R.string.comment_status_approved;
  statusColor=ContextCompat.getColor(getActivity(),R.color.notification_status_unapproved_dark);
break;
case UNAPPROVED:
statusTextResId=R.string.comment_status_unapproved;
statusColor=ContextCompat.getColor(getActivity(),R.color.notification_status_unapproved_dark);
break;
case SPAM:
statusTextResId=R.string.comment_status_spam;
statusColor=ContextCompat.getColor(getActivity(),R.color.comment_status_spam);
break;
case TRASH:
default :
statusTextResId=R.string.comment_status_trash;
statusColor=ContextCompat.getColor(getActivity(),R.color.comment_status_spam);
break;
}
if (canLike()) {
mBtnLikeComment.setVisibility(View.VISIBLE);
if (mComment != null) {
toggleLikeButton(mComment.getILike());
}
 else if (mNote != null) {
mNote.hasLikedComment();
}
}
if (mIsUsersBlog && commentStatus != CommentStatus.APPROVED) {
mTxtStatus.setText(getString(statusTextResId).toUpperCase());
mTxtStatus.setTextColor(statusColor);
if (mTxtStatus.getVisibility() != View.VISIBLE) {
mTxtStatus.clearAnimation();
AniUtils.fadeIn(mTxtStatus,AniUtils.Duration.LONG);
}
}
 else {
mTxtStatus.setVisibility(View.GONE);
}
if (canModerate()) {
setModerateButtonForStatus(commentStatus);
mBtnModerateComment.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
performModerateAction();
}
}
);
mBtnModerateComment.setVisibility(View.VISIBLE);
}
 else {
mBtnModerateComment.setVisibility(View.GONE);
}
if (canMarkAsSpam()) {
mBtnSpamComment.setVisibility(View.VISIBLE);
if (commentStatus == CommentStatus.SPAM) {
mBtnSpamCommentText.setText(R.string.mnu_comment_unspam);
}
 else {
mBtnSpamCommentText.setText(R.string.mnu_comment_spam);
}
}
 else {
mBtnSpamComment.setVisibility(View.GONE);
}
if (canTrash()) {
mBtnTrashComment.setVisibility(View.VISIBLE);
if (commentStatus == CommentStatus.TRASH) {
mBtnModerateIcon.setImageResource(R.drawable.ic_undo_grey_24dp);
mBtnModerateTextView.setText(R.string.mnu_comment_untrash);
mBtnTrashCommentText.setText(R.string.mnu_comment_delete_permanently);
}
 else {
mBtnTrashCommentText.setText(R.string.mnu_comment_trash);
}
}
 else {
mBtnTrashComment.setVisibility(View.GONE);
}
if (canEdit()) {
mBtnEditComment.setVisibility(View.VISIBLE);
}
mLayoutButtons.setVisibility(View.VISIBLE);
}

Fixed version (ground truth):
private void updateStatusViews(){
  if (!isAdded() || mComment == null) {
    return;
  }
  final int statusTextResId;
  final int statusColor;
  CommentStatus commentStatus=CommentStatus.fromString(mComment.getStatus());
switch (commentStatus) {
case APPROVED:
    statusTextResId=R.string.comment_status_approved;
  statusColor=ContextCompat.getColor(getActivity(),R.color.notification_status_unapproved_dark);
break;
case UNAPPROVED:
statusTextResId=R.string.comment_status_unapproved;
statusColor=ContextCompat.getColor(getActivity(),R.color.notification_status_unapproved_dark);
break;
case SPAM:
statusTextResId=R.string.comment_status_spam;
statusColor=ContextCompat.getColor(getActivity(),R.color.comment_status_spam);
break;
case TRASH:
default :
statusTextResId=R.string.comment_status_trash;
statusColor=ContextCompat.getColor(getActivity(),R.color.comment_status_spam);
break;
}
if (canLike()) {
mBtnLikeComment.setVisibility(View.VISIBLE);
if (mComment != null) {
toggleLikeButton(mComment.getILike());
}
 else if (mNote != null) {
mNote.hasLikedComment();
}
}
if (mIsUsersBlog && commentStatus != CommentStatus.APPROVED) {
mTxtStatus.setText(getString(statusTextResId).toUpperCase(Locale.getDefault()));
mTxtStatus.setTextColor(statusColor);
if (mTxtStatus.getVisibility() != View.VISIBLE) {
mTxtStatus.clearAnimation();
AniUtils.fadeIn(mTxtStatus,AniUtils.Duration.LONG);
}
}
 else {
mTxtStatus.setVisibility(View.GONE);
}
if (canModerate()) {
setModerateButtonForStatus(commentStatus);
mBtnModerateComment.setOnClickListener(new View.OnClickListener(){
@Override public void onClick(View v){
performModerateAction();
}
}
);
mBtnModerateComment.setVisibility(View.VISIBLE);
}
 else {
mBtnModerateComment.setVisibility(View.GONE);
}
if (canMarkAsSpam()) {
mBtnSpamComment.setVisibility(View.VISIBLE);
if (commentStatus == CommentStatus.SPAM) {
mBtnSpamCommentText.setText(R.string.mnu_comment_unspam);
}
 else {
mBtnSpamCommentText.setText(R.string.mnu_comment_spam);
}
}
 else {
mBtnSpamComment.setVisibility(View.GONE);
}
if (canTrash()) {
mBtnTrashComment.setVisibility(View.VISIBLE);
if (commentStatus == CommentStatus.TRASH) {
mBtnModerateIcon.setImageResource(R.drawable.ic_undo_grey_24dp);
mBtnModerateTextView.setText(R.string.mnu_comment_untrash);
mBtnTrashCommentText.setText(R.string.mnu_comment_delete_permanently);
}
 else {
mBtnTrashCommentText.setText(R.string.mnu_comment_trash);
}
}
 else {
mBtnTrashComment.setVisibility(View.GONE);
}
if (canEdit()) {
mBtnEditComment.setVisibility(View.VISIBLE);
}
mLayoutButtons.setVisibility(View.VISIBLE);
}