Program: 102958
Project: 102958
Buggy source:
/** 
 * Called by smack when the state of a chat changes.
 * @param chat the chat that is concerned by this event.
 * @param state the new state of the chat.
 * @param message the message containing the new chat state
 */
public void stateChanged(Chat chat,ChatState state,org.jivesoftware.smack.packet.Message message){
  if (logger.isTraceEnabled())   logger.trace(chat.getParticipant() + "String_Node_Str" + state.name()+ "String_Node_Str");
  String fromID=StringUtils.parseBareAddress(chat.getParticipant());
  List<ChatRoom> chatRooms=parentProvider.getOperationSet(OperationSetMultiUserChat.class).getCurrentlyJoinedChatRooms();
  boolean isPrivateMessagingAddress=false;
  for (  ChatRoom chatRoom : chatRooms) {
    if (chatRoom.getName().equals(fromID)) {
      isPrivateMessagingAddress=true;
      break;
    }
  }
  Contact sourceContact=opSetPersPresence.findContactByID((isPrivateMessagingAddress ? message.getFrom() : fromID));
  if (sourceContact == null) {
    sourceContact=opSetPersPresence.createVolatileContact(chat.getParticipant(),isPrivateMessagingAddress);
  }
  int evtCode=STATE_UNKNOWN;
  if (ChatState.composing.equals(state)) {
    evtCode=STATE_TYPING;
  }
 else   if (ChatState.paused.equals(state) || ChatState.active.equals(state)) {
    evtCode=STATE_PAUSED;
  }
 else   if (ChatState.inactive.equals(state) || ChatState.gone.equals(state)) {
    evtCode=STATE_STOPPED;
  }
  if (message.getError() != null)   fireTypingNotificationsDeliveryFailedEvent(sourceContact,evtCode);
 else   if (evtCode != STATE_UNKNOWN)   fireTypingNotificationsEvent(sourceContact,evtCode);
 else   logger.warn("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Called by smack when the state of a chat changes.
 * @param chat the chat that is concerned by this event.
 * @param state the new state of the chat.
 * @param message the message containing the new chat state
 */
public void stateChanged(Chat chat,ChatState state,org.jivesoftware.smack.packet.Message message){
  if (logger.isTraceEnabled())   logger.trace(chat.getParticipant() + "String_Node_Str" + state.name()+ "String_Node_Str");
  String fromID=StringUtils.parseBareAddress(chat.getParticipant());
  List<ChatRoom> chatRooms=parentProvider.getOperationSet(OperationSetMultiUserChat.class).getCurrentlyJoinedChatRooms();
  boolean isPrivateMessagingAddress=false;
  for (  ChatRoom chatRoom : chatRooms) {
    if (chatRoom.getName().equals(fromID)) {
      isPrivateMessagingAddress=true;
      break;
    }
  }
  Contact sourceContact=opSetPersPresence.findContactByID((isPrivateMessagingAddress ? message.getFrom() : fromID));
  if (sourceContact == null) {
    if (message.getError() != null)     sourceContact=opSetPersPresence.findContactByID(message.getFrom());
    if (sourceContact == null) {
      sourceContact=opSetPersPresence.createVolatileContact(chat.getParticipant(),isPrivateMessagingAddress);
    }
  }
  int evtCode=STATE_UNKNOWN;
  if (ChatState.composing.equals(state)) {
    evtCode=STATE_TYPING;
  }
 else   if (ChatState.paused.equals(state) || ChatState.active.equals(state)) {
    evtCode=STATE_PAUSED;
  }
 else   if (ChatState.inactive.equals(state) || ChatState.gone.equals(state)) {
    evtCode=STATE_STOPPED;
  }
  if (message.getError() != null)   fireTypingNotificationsDeliveryFailedEvent(sourceContact,evtCode);
 else   if (evtCode != STATE_UNKNOWN)   fireTypingNotificationsEvent(sourceContact,evtCode);
 else   logger.warn("String_Node_Str");
}