Program: 8554
Project: 8554
Buggy source:
public View getView(int position,View conView,ViewGroup parent){
  AVIMTypedMessage msg=datas.get(position);
  boolean isComMsg=isComeMsg(msg);
  if (conView == null) {
    conView=createViewByType(AVIMReservedMessageType.getAVIMReservedMessageType(msg.getMessageType()),isComMsg);
  }
  TextView sendTimeView=ViewHolder.findViewById(conView,R.id.sendTimeView);
  TextView contentView=ViewHolder.findViewById(conView,R.id.textContent);
  View contentLayout=ViewHolder.findViewById(conView,R.id.contentLayout);
  ImageView imageView=ViewHolder.findViewById(conView,R.id.imageView);
  ImageView avatarView=ViewHolder.findViewById(conView,R.id.avatar);
  PlayButton playBtn=ViewHolder.findViewById(conView,R.id.playBtn);
  TextView locationView=ViewHolder.findViewById(conView,R.id.locationView);
  TextView usernameView=ViewHolder.findViewById(conView,R.id.username);
  View statusSendFailed=ViewHolder.findViewById(conView,R.id.status_send_failed);
  View statusSendSucceed=ViewHolder.findViewById(conView,R.id.status_send_succeed);
  View statusSendStart=ViewHolder.findViewById(conView,R.id.status_send_start);
  if (position == 0 || haveTimeGap(datas.get(position - 1).getTimestamp(),msg.getTimestamp())) {
    sendTimeView.setVisibility(View.VISIBLE);
    sendTimeView.setText(millisecsToDateString(msg.getTimestamp()));
  }
 else {
    sendTimeView.setVisibility(View.GONE);
  }
  UserInfo user=ChatManager.getInstance().getChatManagerAdapter().getUserInfoById(msg.getFrom());
  if (user == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (isComMsg) {
    if (conversationType == null) {
      throw new NullPointerException("String_Node_Str");
    }
    if (conversationType == ConversationType.Single) {
      usernameView.setVisibility(View.GONE);
    }
 else {
      usernameView.setVisibility(View.VISIBLE);
      usernameView.setText(user.getUsername());
    }
  }
  ImageLoader.getInstance().displayImage(user.getAvatarUrl(),avatarView,PhotoUtils.avatarImageOptions);
  AVIMReservedMessageType type=AVIMReservedMessageType.getAVIMReservedMessageType(msg.getMessageType());
switch (type) {
case TextMessageType:
    AVIMTextMessage textMsg=(AVIMTextMessage)msg;
  contentView.setText(EmotionHelper.replace(ChatManager.getContext(),textMsg.getText()));
contentLayout.requestLayout();
break;
case ImageMessageType:
AVIMImageMessage imageMsg=(AVIMImageMessage)msg;
PhotoUtils.displayImageCacheElseNetwork(imageView,MessageHelper.getFilePath(imageMsg),imageMsg.getFileUrl());
setImageOnClickListener(imageView,imageMsg);
break;
case AudioMessageType:
initPlayBtn(msg,playBtn);
break;
case LocationMessageType:
setLocationView(msg,locationView);
break;
default :
break;
}
if (isComMsg == false) {
hideStatusViews(statusSendStart,statusSendFailed,statusSendSucceed);
setSendFailedBtnListener(statusSendFailed,msg);
switch (msg.getMessageStatus()) {
case AVIMMessageStatusFailed:
statusSendFailed.setVisibility(View.VISIBLE);
break;
case AVIMMessageStatusSent:
if (conversationType == ConversationType.Single) {
statusSendSucceed.setVisibility(View.VISIBLE);
}
break;
case AVIMMessageStatusSending:
statusSendStart.setVisibility(View.VISIBLE);
break;
case AVIMMessageStatusNone:
case AVIMMessageStatusReceipt:
break;
}
}
return conView;
}

Fixed version (ground truth):
public View getView(int position,View conView,ViewGroup parent){
  AVIMTypedMessage msg=datas.get(position);
  boolean isComMsg=isComeMsg(msg);
  if (conView == null) {
    conView=createViewByType(AVIMReservedMessageType.getAVIMReservedMessageType(msg.getMessageType()),isComMsg);
  }
  TextView sendTimeView=ViewHolder.findViewById(conView,R.id.sendTimeView);
  TextView contentView=ViewHolder.findViewById(conView,R.id.textContent);
  View contentLayout=ViewHolder.findViewById(conView,R.id.contentLayout);
  ImageView imageView=ViewHolder.findViewById(conView,R.id.imageView);
  ImageView avatarView=ViewHolder.findViewById(conView,R.id.avatar);
  PlayButton playBtn=ViewHolder.findViewById(conView,R.id.playBtn);
  TextView locationView=ViewHolder.findViewById(conView,R.id.locationView);
  TextView usernameView=ViewHolder.findViewById(conView,R.id.username);
  View statusSendFailed=ViewHolder.findViewById(conView,R.id.status_send_failed);
  View statusSendSucceed=ViewHolder.findViewById(conView,R.id.status_send_succeed);
  View statusSendStart=ViewHolder.findViewById(conView,R.id.status_send_start);
  if (position == 0 || haveTimeGap(datas.get(position - 1).getTimestamp(),msg.getTimestamp())) {
    sendTimeView.setVisibility(View.VISIBLE);
    sendTimeView.setText(millisecsToDateString(msg.getTimestamp()));
  }
 else {
    sendTimeView.setVisibility(View.GONE);
  }
  UserInfo user=ChatManager.getInstance().getChatManagerAdapter().getUserInfoById(msg.getFrom());
  if (user == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (isComMsg) {
    if (conversationType == null) {
      return conView;
    }
    if (conversationType == ConversationType.Single) {
      usernameView.setVisibility(View.GONE);
    }
 else {
      usernameView.setVisibility(View.VISIBLE);
      usernameView.setText(user.getUsername());
    }
  }
  ImageLoader.getInstance().displayImage(user.getAvatarUrl(),avatarView,PhotoUtils.avatarImageOptions);
  AVIMReservedMessageType type=AVIMReservedMessageType.getAVIMReservedMessageType(msg.getMessageType());
switch (type) {
case TextMessageType:
    AVIMTextMessage textMsg=(AVIMTextMessage)msg;
  contentView.setText(EmotionHelper.replace(ChatManager.getContext(),textMsg.getText()));
contentLayout.requestLayout();
break;
case ImageMessageType:
AVIMImageMessage imageMsg=(AVIMImageMessage)msg;
PhotoUtils.displayImageCacheElseNetwork(imageView,MessageHelper.getFilePath(imageMsg),imageMsg.getFileUrl());
setImageOnClickListener(imageView,imageMsg);
break;
case AudioMessageType:
initPlayBtn(msg,playBtn);
break;
case LocationMessageType:
setLocationView(msg,locationView);
break;
default :
contentView.setText("String_Node_Str");
contentLayout.requestLayout();
break;
}
if (isComMsg == false) {
hideStatusViews(statusSendStart,statusSendFailed,statusSendSucceed);
setSendFailedBtnListener(statusSendFailed,msg);
switch (msg.getMessageStatus()) {
case AVIMMessageStatusFailed:
statusSendFailed.setVisibility(View.VISIBLE);
break;
case AVIMMessageStatusSent:
if (conversationType == ConversationType.Single) {
statusSendSucceed.setVisibility(View.VISIBLE);
}
break;
case AVIMMessageStatusSending:
statusSendStart.setVisibility(View.VISIBLE);
break;
case AVIMMessageStatusNone:
case AVIMMessageStatusReceipt:
break;
}
}
return conView;
}