Buggy code:
public class MultiRosterView extends ViewPart implements IMultiRosterViewPart , IChatRoomViewCloseListener { public static final String VIEW_ID = "org.eclipse.ecf.presence.ui.MultiRosterView" ; protected static final int DEFAULT_EXPAND_LEVEL = 3 ; protected TreeViewer treeViewer ; protected List rosterAccounts = new ArrayList ( ) ; private Hashtable chatRooms = new Hashtable ( ) ; private IMenuManager setStatusMenu ; private IAction imAction ; private IAction removeAction ; private IAction setAvailableAction ; private IAction setAwayAction ; private IAction setDNDAction ; private IAction setInvisibleAction ; private IAction setOfflineAction ; private IAction openChatRoomAction ; private IAction openAccountChatRoomAction ; private IRosterSubscriptionListener subscriptionListener ; private IPresenceListener presenceListener ; private ViewerFilter showOfflineFilter = new ViewerFilter ( ) { public boolean select ( Viewer viewer , Object parentElement , Object element ) { } } ; private ViewerFilter showEmptyGroupsFilter = new ViewerFilter ( ) { public boolean select ( Viewer viewer , Object parentElement , Object element ) { } } ; public void createPartControl ( Composite parent ) { } protected String getRosterEntryChildrenFromPresence ( IRosterEntry entry ) { } protected void setupTreeViewer ( Composite parent ) { } private void retrieveServices ( ) { } private String getChatRoomSecondaryID ( ID roomID ) { } private void showChatRooms ( IChatRoomManager [ ] managers ) { ChatRoomSelectionDialog dialog = new ChatRoomSelectionDialog ( getViewSite ( ) . getShell ( ) , managers ) ; dialog . open ( ) ; if ( ( dialog . getReturnCode ( ) ) != ( Window . OK ) ) return ; ChatRoomSelectionDialog . Room room = dialog . getSelectedRoom ( ) ; if ( room == null ) { MessageDialog . openInformation ( getViewSite ( ) . getShell ( ) , "No<seq2seq4repair_space>room<seq2seq4repair_space>selected" , "Cannot<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>null<seq2seq4repair_space>room" ) ; return ; } IChatRoomInfo selectedInfo = room . getRoomInfo ( ) ; if ( selectedInfo == null ) { MessageDialog . openInformation ( getViewSite ( ) . getShell ( ) , "No<seq2seq4repair_space>room<seq2seq4repair_space>selected" , "Cannot<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>null<seq2seq4repair_space>room" ) ; return ; } String secondaryID = getChatRoomSecondaryID ( selectedInfo . getRoomID ( ) ) ; if ( secondaryID == null ) { MessageDialog . openError ( getViewSite ( ) . getShell ( ) , "Could<seq2seq4repair_space>not<seq2seq4repair_space>get<seq2seq4repair_space>identifier<seq2seq4repair_space>for<seq2seq4repair_space>room" , ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>get<seq2seq4repair_space>proper<seq2seq4repair_space>identifier<seq2seq4repair_space>for<seq2seq4repair_space>chat<seq2seq4repair_space>room<seq2seq4repair_space>" + ( selectedInfo . getRoomID ( ) ) ) ) ; return ; } IWorkbenchWindow ww = getViewSite ( ) . getPage ( ) . getWorkbenchWindow ( ) ; IWorkbenchPage wp = ww . getActivePage ( ) ; MultiRosterView . RoomWithAView roomView = getRoomView ( secondaryID ) ; if ( roomView != null ) { wp . activate ( roomView . getView ( ) ) ; return ; } IChatRoomContainer chatRoom = null ; try { chatRoom = selectedInfo . createChatRoomContainer ( ) ; } catch ( ContainerCreateException e1 ) { MessageDialog . openError ( getViewSite ( ) . getShell ( ) , "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>chat<seq2seq4repair_space>room" , "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>chat<seq2seq4repair_space>room<seq2seq4repair_space>for<seq2seq4repair_space>account" ) ; return ; } IChatRoomMessageSender sender = chatRoom . getChatRoomMessageSender ( ) ; IViewPart view = null ; try { IViewReference ref = wp . findViewReference ( "org.eclipse.ecf.ui.views.ChatRoomView" , secondaryID ) ; if ( ref == null ) { view = wp . showView ( "org.eclipse.ecf.ui.views.ChatRoomView" , secondaryID , VIEW_ACTIVATE ) ; } else { view = ref . getView ( true ) ; } final ChatRoomView chatroomview = ( ( ChatRoomView ) ( view ) ) ; chatroomview . initialize ( this , secondaryID , chatRoom , selectedInfo , sender ) ; chatRoom . addMessageListener ( new IIMMessageListener ( ) { public void handleMessageEvent ( IIMMessageEvent messageEvent ) { if ( messageEvent instanceof IChatRoomMessageEvent ) { IChatRoomMessage m = ( ( IChatRoomMessageEvent ) ( messageEvent ) ) . getChatRoomMessage ( ) ; chatroomview . handleMessage ( m . getFromID ( ) , m . getMessage ( ) ) ; } } } ) ; chatRoom . addChatRoomParticipantListener ( new IChatRoomParticipantListener ( ) { <START_BUG> public void handlePresence ( ID fromID , IPresence presence ) { <END_BUG> chatroomview . handlePresence ( fromID , presence ) ; } public void handleArrived ( IUser participant ) { chatroomview . handleJoin ( participant ) ; } public void handleDeparted ( IUser participant ) { chatroomview . handleLeave ( participant ) ; } public void handleUpdated ( IUser updatedParticipant ) { chatroomview . handleUpdated ( updatedParticipant ) ; } } ) ; } catch ( PartInitException e ) { MessageDialog . openError ( getViewSite ( ) . getShell ( ) , "Can't<seq2seq4repair_space>initialize<seq2seq4repair_space>chat<seq2seq4repair_space>room<seq2seq4repair_space>view" , ( ( "Unexpected<seq2seq4repair_space>error<seq2seq4repair_space>initializing<seq2seq4repair_space>for<seq2seq4repair_space>chat<seq2seq4repair_space>room:<seq2seq4repair_space>" + ( selectedInfo . getName ( ) ) ) + ".<seq2seq4repair_space>Please<seq2seq4repair_space>see<seq2seq4repair_space>Error<seq2seq4repair_space>Log<seq2seq4repair_space>for<seq2seq4repair_space>details" ) ) ; return ; } try { chatRoom . connect ( selectedInfo . getRoomID ( ) , getChatJoinContext ( ( "Nickname<seq2seq4repair_space>for<seq2seq4repair_space>" + ( selectedInfo . getName ( ) ) ) ) ) ; addRoomView ( new MultiRosterView . RoomWithAView ( chatRoom , ( ( ChatRoomView ) ( view ) ) , secondaryID ) ) ; } catch ( ContainerConnectException e1 ) { MessageDialog . openError ( getViewSite ( ) . getShell ( ) , "Could<seq2seq4repair_space>not<seq2seq4repair_space>connect" , ( ( ( "Cannot<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>chat<seq2seq4repair_space>room<seq2seq4repair_space>" + ( selectedInfo . getName ( ) ) ) + ",<seq2seq4repair_space>message:<seq2seq4repair_space>" ) + ( e1 . getMessage ( ) ) ) ) ; } } private void addRoomView ( MultiRosterView . RoomWithAView roomView ) { } private MultiRosterView . RoomWithAView getRoomView ( String id ) { } private void removeRoomView ( MultiRosterView . RoomWithAView roomView ) { } public void chatRoomViewClosing ( String secondaryID ) { } private IConnectContext getChatJoinContext ( final String windowText ) { } private void makeActions ( ) { } private void sendPresence ( IPresence . Mode mode ) { } private void hookContextMenu ( ) { } private void fillContextMenu ( IMenuManager manager ) { } private IRosterEntry find ( Collection items , ID userID ) { } private void remove ( IRosterEntry entry ) { } private void message ( IStructuredSelection iss ) { } private void contributeToActionBars ( ) { } private void fillLocalPullDown ( IMenuManager manager ) { } public void dispose ( ) { } protected boolean addRosterAccount ( MultiRosterAccount account ) { } public void setFocus ( ) { }

Fix:
public void handlePresenceUpdated ( ID fromID , IPresence presence ) {