Program: 103794
Project: 103794
Buggy source:
/** 
 * Creates a chat room, by specifying the chat room name, the parent protocol provider and eventually, the contacts invited to participate in  this chat room.
 * @param roomName the name of the room
 * @param protocolProvider the parent protocol provider.
 * @param contacts the contacts invited when creating the chat room.
 * @return the <tt>ChatRoomWrapper</tt> corresponding to the created room
 */
public ChatRoomWrapper createChatRoom(String roomName,ProtocolProviderService protocolProvider,Collection<String> contacts){
  ChatRoomWrapper chatRoomWrapper=null;
  OperationSetMultiUserChat groupChatOpSet=protocolProvider.getOperationSet(OperationSetMultiUserChat.class);
  if (groupChatOpSet == null)   return null;
  ChatRoom chatRoom=null;
  try {
    Map<String,Object> members=new Hashtable<String,Object>();
    OperationSetPersistentPresence opSet=protocolProvider.getOperationSet(OperationSetPersistentPresence.class);
    for (    String contact : contacts)     members.put(contact,opSet.findContactByID(contact));
    chatRoom=groupChatOpSet.createChatRoom(roomName,members);
  }
 catch (  OperationFailedException ex) {
    logger.error("String_Node_Str",ex);
    new ErrorDialog(GuiActivator.getUIService().getMainFrame(),GuiActivator.getResources().getI18NString("String_Node_Str"),GuiActivator.getResources().getI18NString("String_Node_Str",new String[]{protocolProvider.getProtocolName()}),ex).showDialog();
  }
catch (  OperationNotSupportedException ex) {
    logger.error("String_Node_Str",ex);
    new ErrorDialog(GuiActivator.getUIService().getMainFrame(),GuiActivator.getResources().getI18NString("String_Node_Str"),GuiActivator.getResources().getI18NString("String_Node_Str",new String[]{protocolProvider.getProtocolName()}),ex).showDialog();
  }
  if (chatRoom != null) {
    ChatRoomProviderWrapper parentProvider=chatRoomList.findServerWrapperFromProvider(protocolProvider);
    chatRoomWrapper=new ChatRoomWrapper(parentProvider,chatRoom);
    chatRoomList.addChatRoom(chatRoomWrapper);
    fireChatRoomListChangedEvent(chatRoomWrapper,ChatRoomListChangeEvent.CHAT_ROOM_ADDED);
  }
  return chatRoomWrapper;
}

Fixed version (ground truth):
/** 
 * Creates a chat room, by specifying the chat room name, the parent protocol provider and eventually, the contacts invited to participate in  this chat room.
 * @param roomName the name of the room
 * @param protocolProvider the parent protocol provider.
 * @param contacts the contacts invited when creating the chat room.
 * @param reason
 * @return the <tt>ChatRoomWrapper</tt> corresponding to the created room
 */
public ChatRoomWrapper createChatRoom(String roomName,ProtocolProviderService protocolProvider,Collection<String> contacts,String reason){
  ChatRoomWrapper chatRoomWrapper=null;
  OperationSetMultiUserChat groupChatOpSet=protocolProvider.getOperationSet(OperationSetMultiUserChat.class);
  if (groupChatOpSet == null)   return null;
  ChatRoom chatRoom=null;
  try {
    chatRoom=groupChatOpSet.createChatRoom(roomName,null);
    chatRoom.join();
    for (    String contact : contacts)     chatRoom.invite(contact,reason);
  }
 catch (  OperationFailedException ex) {
    logger.error("String_Node_Str",ex);
    new ErrorDialog(GuiActivator.getUIService().getMainFrame(),GuiActivator.getResources().getI18NString("String_Node_Str"),GuiActivator.getResources().getI18NString("String_Node_Str",new String[]{protocolProvider.getProtocolName()}),ex).showDialog();
  }
catch (  OperationNotSupportedException ex) {
    logger.error("String_Node_Str",ex);
    new ErrorDialog(GuiActivator.getUIService().getMainFrame(),GuiActivator.getResources().getI18NString("String_Node_Str"),GuiActivator.getResources().getI18NString("String_Node_Str",new String[]{protocolProvider.getProtocolName()}),ex).showDialog();
  }
  if (chatRoom != null) {
    ChatRoomProviderWrapper parentProvider=chatRoomList.findServerWrapperFromProvider(protocolProvider);
    chatRoomWrapper=new ChatRoomWrapper(parentProvider,chatRoom);
    chatRoomList.addChatRoom(chatRoomWrapper);
    fireChatRoomListChangedEvent(chatRoomWrapper,ChatRoomListChangeEvent.CHAT_ROOM_ADDED);
  }
  return chatRoomWrapper;
}