Program: 114160
Project: 114160
Buggy source:
@Override public void bindView(View view,Context context,Cursor cursor){
  ViewHolder viewHolder=(ViewHolder)view.getTag();
  String avatarUrl=null;
  String senderName;
  MessageCache messageCache=ChatDatabaseManager.getMessageCacheFromCursor(cursor);
  boolean ownMessage=isOwnMessage(messageCache.getSenderId());
  boolean notificationMessage=messageCache.getMessagesNotificationType() != null;
  if (notificationMessage) {
    viewHolder.messageTextView.setText(messageCache.getMessage());
    viewHolder.timeTextMessageTextView.setText(DateUtils.longToMessageDate(messageCache.getTime()));
  }
 else {
    resetUI(viewHolder);
    if (ownMessage) {
      avatarUrl=getAvatarUrlForCurrentUser();
    }
 else {
      User senderFriend=UsersDatabaseManager.getUserById(context,messageCache.getSenderId());
      if (senderFriend != null) {
        senderName=senderFriend.getFullName();
        avatarUrl=getAvatarUrlForFriend(senderFriend);
      }
 else {
        senderName=messageCache.getSenderId() + ConstsCore.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);
    QBUpdateStatusMessageCommand.start(context,dialog,messageCache,false);
  }
  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=ChatDatabaseManager.getMessageCacheFromCursor(cursor);
  boolean ownMessage=isOwnMessage(messageCache.getSenderId());
  boolean notificationMessage=messageCache.getMessagesNotificationType() != null;
  if (notificationMessage) {
    viewHolder.messageTextView.setText(messageCache.getMessage());
    viewHolder.timeTextMessageTextView.setText(DateUtils.longToMessageDate(messageCache.getTime()));
  }
 else {
    resetUI(viewHolder);
    if (ownMessage) {
      avatarUrl=getAvatarUrlForCurrentUser();
    }
 else {
      User senderFriend=DatabaseManager.getInstance().getUserManager().get(messageCache.getSenderId());
      if (senderFriend != null) {
        senderName=senderFriend.getFullName();
        avatarUrl=getAvatarUrlForFriend(senderFriend);
      }
 else {
        senderName=messageCache.getSenderId() + ConstsCore.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);
    QBUpdateStatusMessageCommand.start(context,dialog,messageCache,false);
  }
  displayAvatarImage(avatarUrl,viewHolder.avatarImageView);
}