Program: 114364
Project: 114364
Buggy source:
@Override public void bindView(View view,Context context,Cursor cursor){
  ViewHolder viewHolder=(ViewHolder)view.getTag();
  String avatarUrl=null;
  String senderName;
  MessageCache messageCache=DatabaseManager.getMessageCacheFromCursor(cursor);
  boolean ownMessage=isOwnMessage(messageCache.getSenderId());
  resetUI(viewHolder);
  viewHolder.messageDeliveryStatusImageView=(ImageView)view.findViewById(R.id.text_message_delivery_status_imageview);
  viewHolder.messageDeliveryStatusImageView=(ImageView)view.findViewById(R.id.attach_message_delivery_status_imageview);
  if (ownMessage) {
    avatarUrl=getAvatarUrlForCurrentUser();
  }
 else {
    setMessageStatus(view,viewHolder,R.id.text_message_delivery_status_imageview,messageCache.isDelivered(),messageCache.isRead());
    User senderFriend=DatabaseManager.getUserById(context,messageCache.getSenderId());
    if (senderFriend != null) {
      senderName=senderFriend.getFullName();
      avatarUrl=getAvatarUrlForFriend(senderFriend);
    }
 else {
      senderName=messageCache.getSenderId() + Consts.EMPTY_STRING;
    }
    viewHolder.nameTextView.setTextColor(getTextColor(messageCache.getSenderId()));
    viewHolder.nameTextView.setText(senderName);
  }
  if (!TextUtils.isEmpty(messageCache.getAttachUrl())) {
    viewHolder.timeAttachMessageTextView.setText(DateUtils.longToMessageDate(messageCache.getTime()));
    setViewVisibility(viewHolder.progressRelativeLayout,View.VISIBLE);
    displayAttachImage(messageCache.getAttachUrl(),viewHolder);
  }
 else {
    setViewVisibility(viewHolder.textMessageView,View.VISIBLE);
    viewHolder.timeTextMessageTextView.setText(DateUtils.longToMessageDate(messageCache.getTime()));
    viewHolder.messageTextView.setText(messageCache.getMessage());
  }
  if (!messageCache.isRead() && ownMessage) {
    messageCache.setRead(true);
    QBUpdateStatusMessageReadCommand.start(context,dialog,messageCache);
  }
  displayAvatarImage(avatarUrl,viewHolder.avatarImageView);
}

Fixed version (ground truth):
@Override public void bindView(View view,Context context,Cursor cursor){
  ViewHolder viewHolder=(ViewHolder)view.getTag();
  String avatarUrl=null;
  String senderName;
  MessageCache messageCache=DatabaseManager.getMessageCacheFromCursor(cursor);
  boolean ownMessage=isOwnMessage(messageCache.getSenderId());
  resetUI(viewHolder);
  viewHolder.messageDeliveryStatusImageView=(ImageView)view.findViewById(R.id.text_message_delivery_status_imageview);
  viewHolder.messageDeliveryStatusImageView=(ImageView)view.findViewById(R.id.attach_message_delivery_status_imageview);
  if (ownMessage) {
    avatarUrl=getAvatarUrlForCurrentUser();
  }
 else {
    User senderFriend=DatabaseManager.getUserById(context,messageCache.getSenderId());
    if (senderFriend != null) {
      senderName=senderFriend.getFullName();
      avatarUrl=getAvatarUrlForFriend(senderFriend);
    }
 else {
      senderName=messageCache.getSenderId() + Consts.EMPTY_STRING;
    }
    viewHolder.nameTextView.setTextColor(getTextColor(messageCache.getSenderId()));
    viewHolder.nameTextView.setText(senderName);
  }
  if (!TextUtils.isEmpty(messageCache.getAttachUrl())) {
    viewHolder.timeAttachMessageTextView.setText(DateUtils.longToMessageDate(messageCache.getTime()));
    setViewVisibility(viewHolder.progressRelativeLayout,View.VISIBLE);
    displayAttachImage(messageCache.getAttachUrl(),viewHolder);
  }
 else {
    setViewVisibility(viewHolder.textMessageView,View.VISIBLE);
    viewHolder.timeTextMessageTextView.setText(DateUtils.longToMessageDate(messageCache.getTime()));
    viewHolder.messageTextView.setText(messageCache.getMessage());
  }
  if (!messageCache.isRead() && ownMessage) {
    messageCache.setRead(true);
    QBUpdateStatusMessageReadCommand.start(context,dialog,messageCache);
  }
  displayAvatarImage(avatarUrl,viewHolder.avatarImageView);
}