Buggy code:
final class MSNContainer implements IContainer , IPresenceContainerAdapter , IPresenceSender , IChatManager , IChatMessageSender , ITypingMessageSender , IRoster , IRosterManager , IRosterSubscriptionSender { private static final long serialVersionUID = 1676711994010767942L ; private final Map chatSessions ; private final List containerListeners ; private final List updateListeners ; private final List messageListeners ; private final List presenceListeners ; private final List subscriptionListeners ; private final List entries ; private final IUser user ; private MsnClient client ; private final ID guid ; private ID connectID ; protected IHistoryManager historyManager = new IHistoryManager ( ) { public IHistory getHistory ( ID partnerID , Map options ) { } public Object getAdapter ( Class adapter ) { } public boolean isActive ( ) { } public void makeActive ( boolean active , Map options ) { } } ; MSNContainer ( ) throws IDCreateException { } public synchronized void connect ( ID targetID , IConnectContext connectContext ) throws ContainerConnectException { } private MSNRosterEntry findEntry ( Collection entries , String email ) { } public synchronized void disconnect ( ) { } public void dispose ( ) { } private void fireContainerEvent ( IContainerEvent event ) { } private void fireMessageEvent ( ID fromID , ID toID , String message ) { } private void fireRosterUpdate ( IRosterItem item ) { } private void fireRosterEntryAdded ( IRosterEntry entry ) { } private void fireRosterEntryUpdated ( IRosterEntry entry ) { } private void fireHandleSubscriptionRequest ( ID fromID ) { } private void fireHandleUnsubscribed ( ID fromID ) { } public Object getAdapter ( Class serviceType ) { } public Namespace getConnectNamespace ( ) { } public ID getConnectedID ( ) { } public ID getID ( ) { } public IAccountManager getAccountManager ( ) { } public IChatRoomManager getChatRoomManager ( ) { } public IPresenceSender getPresenceSender ( ) { } public void addListener ( IContainerListener listener ) { } public void removeListener ( IContainerListener listener ) { } private class ChatSessionListener implements IChatSessionListener { private ID toID ; private ChatSessionListener ( ID toID ) { } public void contactIsTyping ( Contact contact ) { } public void contactJoined ( Contact contact ) { } public void contactLeft ( Contact contact ) { } public void messageReceived ( Contact contact , String message ) { <START_BUG> fireMessageEvent ( toID , toID , message ) ; <END_BUG> } public void sessionTimedOut ( ) { } } public void sendPresenceUpdate ( ID toID , IPresence presence ) throws ECFException { } public IRosterManager getRosterManager ( ) { } public void addRosterUpdateListener ( IRosterUpdateListener listener ) { } public IRoster getRoster ( ) { } public IRosterSubscriptionSender getRosterSubscriptionSender ( ) { } public void addRosterSubscriptionListener ( IRosterSubscriptionListener listener ) { } public void removeRosterSubscriptionListener ( IRosterSubscriptionListener listener ) { } public void removeRosterUpdateListener ( IRosterUpdateListener listener ) { } public Collection getItems ( ) { } public IUser getUser ( ) { } public void addPresenceListener ( IPresenceListener listener ) { } public void removePresenceListener ( IPresenceListener listener ) { } public IChatManager getChatManager ( ) { } public IChatMessageSender getChatMessageSender ( ) { } public ITypingMessageSender getTypingMessageSender ( ) { } public void sendChatMessage ( ID toID , ID threadID , Type type , String subject , String body , Map properties ) throws ECFException { } public void sendChatMessage ( ID toID , String body ) throws ECFException { } public void sendTypingMessage ( ID toID , boolean isTyping , String body ) throws ECFException { } public void addMessageListener ( IIMMessageListener listener ) { } public void removeMessageListener ( IIMMessageListener listener ) { } private class Account implements IUser { private static final long serialVersionUID = 7497082891662391996L ; public Object getAdapter ( Class adapter ) { } public ID getID ( ) { } public Map getProperties ( ) { } public String getName ( ) { } public String getNickname ( ) { } } public void sendRosterAdd ( String user , String name , String [ ] groups ) throws ECFException { } public void sendRosterRemove ( ID userID ) throws ECFException { } public String getName ( ) { } public IRosterItem getParent ( ) { } public IHistoryManager getHistoryManager ( ) { } }

Fix:
fireMessageEvent ( toID , connectID , message ) ;