Program: 103363
Project: 103363
Buggy source:
/** 
 * Process a packet.
 * @param packet to process.
 */
public void processPacket(Packet packet){
  if (!(packet instanceof org.jivesoftware.smack.packet.Message))   return;
  org.jivesoftware.smack.packet.Message msg=(org.jivesoftware.smack.packet.Message)packet;
  long timeStamp;
  DelayInformation delay=(DelayInformation)msg.getExtension("String_Node_Str","String_Node_Str");
  if (delay != null) {
    timeStamp=delay.getStamp().getTime();
  }
 else {
    timeStamp=System.currentTimeMillis();
  }
  String msgBody=msg.getBody();
  if (msgBody == null)   return;
  int messageReceivedEventType=ChatRoomMessageReceivedEvent.CONVERSATION_MESSAGE_RECEIVED;
  String msgFrom=msg.getFrom();
  ChatRoomMember member=null;
  String fromUserName=StringUtils.parseResource(msgFrom);
  if (nickname.equals(getNickName(fromUserName)))   return;
  if (msgFrom.equals(getName())) {
    messageReceivedEventType=ChatRoomMessageReceivedEvent.SYSTEM_MESSAGE_RECEIVED;
    member=new ChatRoomMemberJabberImpl(ChatRoomJabberImpl.this,getName(),getName());
  }
 else {
    member=smackParticipantToScMember(msgFrom);
  }
  if (member == null) {
    member=new ChatRoomMemberJabberImpl(ChatRoomJabberImpl.this,fromUserName,msgFrom);
  }
  if (logger.isDebugEnabled()) {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + fromUserName + "String_Node_Str"+ msg.toXML());
  }
  Message newMessage=createMessage(msgBody);
  if (msg.getType() == org.jivesoftware.smack.packet.Message.Type.error) {
    if (logger.isInfoEnabled())     logger.info("String_Node_Str" + fromUserName);
    XMPPError error=packet.getError();
    int errorCode=error.getCode();
    int errorResultCode=ChatRoomMessageDeliveryFailedEvent.UNKNOWN_ERROR;
    String errorReason=error.getMessage();
    if (errorCode == 503) {
      org.jivesoftware.smackx.packet.MessageEvent msgEvent=(org.jivesoftware.smackx.packet.MessageEvent)packet.getExtension("String_Node_Str","String_Node_Str");
      if (msgEvent != null && msgEvent.isOffline()) {
        errorResultCode=ChatRoomMessageDeliveryFailedEvent.OFFLINE_MESSAGES_NOT_SUPPORTED;
      }
    }
    ChatRoomMessageDeliveryFailedEvent evt=new ChatRoomMessageDeliveryFailedEvent(ChatRoomJabberImpl.this,member,errorResultCode,errorReason,new Date(),newMessage);
    fireMessageEvent(evt);
    return;
  }
  ChatRoomMessageReceivedEvent msgReceivedEvt=new ChatRoomMessageReceivedEvent(ChatRoomJabberImpl.this,member,timeStamp,newMessage,messageReceivedEventType);
  if (delay != null)   msgReceivedEvt.setHistoryMessage(true);
  fireMessageEvent(msgReceivedEvt);
}

Fixed version (ground truth):
/** 
 * Process a packet.
 * @param packet to process.
 */
public void processPacket(Packet packet){
  if (!(packet instanceof org.jivesoftware.smack.packet.Message))   return;
  org.jivesoftware.smack.packet.Message msg=(org.jivesoftware.smack.packet.Message)packet;
  long timeStamp;
  DelayInformation delay=(DelayInformation)msg.getExtension("String_Node_Str","String_Node_Str");
  if (delay != null) {
    timeStamp=delay.getStamp().getTime();
  }
 else {
    timeStamp=System.currentTimeMillis();
  }
  String msgBody=msg.getBody();
  if (msgBody == null)   return;
  int messageReceivedEventType=ChatRoomMessageReceivedEvent.CONVERSATION_MESSAGE_RECEIVED;
  String msgFrom=msg.getFrom();
  ChatRoomMember member=null;
  String fromUserName=StringUtils.parseResource(msgFrom);
  if (getUserNickname().equals(fromUserName))   return;
  if (msgFrom.equals(getName())) {
    messageReceivedEventType=ChatRoomMessageReceivedEvent.SYSTEM_MESSAGE_RECEIVED;
    member=new ChatRoomMemberJabberImpl(ChatRoomJabberImpl.this,getName(),getName());
  }
 else {
    member=smackParticipantToScMember(msgFrom);
  }
  if (member == null) {
    member=new ChatRoomMemberJabberImpl(ChatRoomJabberImpl.this,fromUserName,msgFrom);
  }
  if (logger.isDebugEnabled()) {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + fromUserName + "String_Node_Str"+ msg.toXML());
  }
  Message newMessage=createMessage(msgBody);
  if (msg.getType() == org.jivesoftware.smack.packet.Message.Type.error) {
    if (logger.isInfoEnabled())     logger.info("String_Node_Str" + fromUserName);
    XMPPError error=packet.getError();
    int errorCode=error.getCode();
    int errorResultCode=ChatRoomMessageDeliveryFailedEvent.UNKNOWN_ERROR;
    String errorReason=error.getMessage();
    if (errorCode == 503) {
      org.jivesoftware.smackx.packet.MessageEvent msgEvent=(org.jivesoftware.smackx.packet.MessageEvent)packet.getExtension("String_Node_Str","String_Node_Str");
      if (msgEvent != null && msgEvent.isOffline()) {
        errorResultCode=ChatRoomMessageDeliveryFailedEvent.OFFLINE_MESSAGES_NOT_SUPPORTED;
      }
    }
    ChatRoomMessageDeliveryFailedEvent evt=new ChatRoomMessageDeliveryFailedEvent(ChatRoomJabberImpl.this,member,errorResultCode,errorReason,new Date(),newMessage);
    fireMessageEvent(evt);
    return;
  }
  ChatRoomMessageReceivedEvent msgReceivedEvt=new ChatRoomMessageReceivedEvent(ChatRoomJabberImpl.this,member,timeStamp,newMessage,messageReceivedEventType);
  if (delay != null)   msgReceivedEvt.setHistoryMessage(true);
  fireMessageEvent(msgReceivedEvt);
}