Program: 171969
Project: 171969
Buggy source:
@Override public void execute(Intent intent,Throwable error){
  if (operation.getCode() == AVIMOperation.CONVERSATION_QUIT.getCode()) {
    client.removeConversationCache(AVIMConversation.this);
  }
  if (error == null && occ != null) {
    occ.onComplete();
  }
 else   if (error != null && occ != null) {
    occ.onFailure();
  }
  if (message != null) {
    if (error == null) {
      long timestamp=intent.getExtras().getLong(Conversation.callbackMessageTimeStamp,-1);
      String messageId=intent.getStringExtra(Conversation.callbackMessageId);
      message.setMessageId(messageId);
      message.setMessageStatus(AVIMMessage.AVIMMessageStatus.AVIMMessageStatusSent);
      if (timestamp != -1) {
        message.setTimestamp(timestamp);
      }
      if (null == messageOption || !messageOption.isTransient() && AVIMClient.messageQueryCacheEnabled) {
        setLastMessage(message);
        storage.insertLocalMessage(message);
      }
      AVIMConversation.this.lastMessageAt=new Date(timestamp);
      storage.updateConversationLastMessageAt(AVIMConversation.this);
    }
 else {
      message.setMessageStatus(AVIMMessage.AVIMMessageStatus.AVIMMessageStatusFailed);
    }
  }
  if (operation.getCode() == AVIMOperation.CONVERSATION_MESSAGE_QUERY.getCode()) {
    List<AVIMMessage> historyMessages=intent.getParcelableArrayListExtra(Conversation.callbackHistoryMessages);
    setLastReadAt(intent.getLongExtra(Conversation.callbackReadAt,0L),false);
    setLastDeliveredAt(intent.getLongExtra(Conversation.callbackDeliveredAt,0L),false);
    storage.updateConversationTimes(AVIMConversation.this);
    if (error != null) {
      callback.internalDone(null,AVIMException.wrapperAVException(error));
    }
 else {
      if (historyMessages == null) {
        historyMessages=Collections.EMPTY_LIST;
      }
      callback.internalDone(historyMessages,null);
    }
    return;
  }
  if (operation.getCode() == AVIMOperation.CONVERSATION_UPDATE.getCode()) {
    if (intent.getExtras().containsKey(Conversation.callbackUpdatedAt)) {
      String updatedAt=intent.getExtras().getString(Conversation.callbackUpdatedAt);
      AVIMConversation.this.updatedAt=updatedAt;
    }
  }
  if (operation.getCode() == AVIMOperation.CONVERSATION_MEMBER_COUNT_QUERY.getCode()) {
    int memberCount=intent.getIntExtra(Conversation.callbackMemberCount,0);
    callback.internalDone(memberCount,AVIMException.wrapperAVException(error));
    return;
  }
  if (operation.getCode() == AVIMOperation.CONVERSATION_FETCH_RECEIPT_TIME.getCode()) {
    setLastReadAt(intent.getLongExtra(Conversation.callbackReadAt,0L),false);
    setLastDeliveredAt(intent.getLongExtra(Conversation.callbackDeliveredAt,0L),false);
    storage.updateConversationTimes(AVIMConversation.this);
    callback.internalDone(null,AVIMException.wrapperAVException(error));
    return;
  }
  if (operation.getCode() == AVIMOperation.CONVERSATION_QUERY.getCode()) {
    if (null != error) {
      callback.internalDone(null,AVIMException.wrapperAVException(error));
    }
 else {
      Exception exception=processQueryResult(intent.getExtras().getSerializable(Conversation.callbackData));
      callback.internalDone(null,AVIMException.wrapperAVException(exception));
    }
    return;
  }
  callback.internalDone(null,AVIMException.wrapperAVException(error));
}

Fixed version (ground truth):
@Override public void execute(Intent intent,Throwable error){
  if (operation.getCode() == AVIMOperation.CONVERSATION_QUIT.getCode()) {
    client.removeConversationCache(AVIMConversation.this);
  }
  if (error == null && occ != null) {
    occ.onComplete();
  }
 else   if (error != null && occ != null) {
    occ.onFailure();
  }
  if (message != null) {
    if (error == null) {
      long timestamp=intent.getExtras().getLong(Conversation.callbackMessageTimeStamp,-1);
      String messageId=intent.getStringExtra(Conversation.callbackMessageId);
      message.setMessageId(messageId);
      message.setMessageStatus(AVIMMessage.AVIMMessageStatus.AVIMMessageStatusSent);
      if (timestamp != -1) {
        message.setTimestamp(timestamp);
      }
      if (null == messageOption || !messageOption.isTransient() && AVIMClient.messageQueryCacheEnabled) {
        setLastMessage(message);
        storage.insertLocalMessage(message);
      }
      AVIMConversation.this.lastMessageAt=new Date(timestamp);
      storage.updateConversationLastMessageAt(AVIMConversation.this);
    }
 else {
      message.setMessageStatus(AVIMMessage.AVIMMessageStatus.AVIMMessageStatusFailed);
    }
  }
  if (operation.getCode() == AVIMOperation.CONVERSATION_MESSAGE_QUERY.getCode()) {
    List<AVIMMessage> historyMessages=intent.getParcelableArrayListExtra(Conversation.callbackHistoryMessages);
    if (error != null) {
      callback.internalDone(null,new AVIMException(AVIMException.TIMEOUT,AVException.CONNECTION_FAILED,error.getMessage()));
    }
 else {
      setLastReadAt(intent.getLongExtra(Conversation.callbackReadAt,0L),false);
      setLastDeliveredAt(intent.getLongExtra(Conversation.callbackDeliveredAt,0L),false);
      storage.updateConversationTimes(AVIMConversation.this);
      if (historyMessages == null) {
        historyMessages=Collections.EMPTY_LIST;
      }
      callback.internalDone(historyMessages,null);
    }
    return;
  }
  if (operation.getCode() == AVIMOperation.CONVERSATION_UPDATE.getCode()) {
    if (intent.getExtras().containsKey(Conversation.callbackUpdatedAt)) {
      String updatedAt=intent.getExtras().getString(Conversation.callbackUpdatedAt);
      AVIMConversation.this.updatedAt=updatedAt;
    }
  }
  if (operation.getCode() == AVIMOperation.CONVERSATION_MEMBER_COUNT_QUERY.getCode()) {
    int memberCount=intent.getIntExtra(Conversation.callbackMemberCount,0);
    callback.internalDone(memberCount,AVIMException.wrapperAVException(error));
    return;
  }
  if (operation.getCode() == AVIMOperation.CONVERSATION_FETCH_RECEIPT_TIME.getCode()) {
    setLastReadAt(intent.getLongExtra(Conversation.callbackReadAt,0L),false);
    setLastDeliveredAt(intent.getLongExtra(Conversation.callbackDeliveredAt,0L),false);
    storage.updateConversationTimes(AVIMConversation.this);
    callback.internalDone(null,AVIMException.wrapperAVException(error));
    return;
  }
  if (operation.getCode() == AVIMOperation.CONVERSATION_QUERY.getCode()) {
    if (null != error) {
      callback.internalDone(null,AVIMException.wrapperAVException(error));
    }
 else {
      Exception exception=processQueryResult(intent.getExtras().getSerializable(Conversation.callbackData));
      callback.internalDone(null,AVIMException.wrapperAVException(exception));
    }
    return;
  }
  callback.internalDone(null,AVIMException.wrapperAVException(error));
}