Buggy code:
public class CollabClient { public static final String WORKSPACE_NAME = "<workspace>" ; public static final String GENERIC_CONTAINER_CLIENT_NAME = "ecf.generic.client" ; static Hashtable clients = new Hashtable ( ) ; static CollabClient collabClient = new CollabClient ( ) ; PresenceContainerUI presenceContainerUI = null ; IRCChatRoomManagerUI ircchatRoomManagerUI = null ; public void createAndConnectClient ( final String containerType , String uri , String nickname , final Object connectData , final IResource resource ) throws Exception { final IContainer newClient = ContainerFactory . getDefault ( ) . createContainer ( containerType ) ; Namespace targetNamespace = newClient . getConnectNamespace ( ) ; ID targetID = IDFactory . getDefault ( ) . createID ( targetNamespace , uri ) ; String username = setupUsername ( targetID , nickname ) ; final ClientEntry newClientEntry = new ClientEntry ( containerType , newClient ) ; IChatRoomManager man = ( ( IChatRoomManager ) ( newClient . getAdapter ( IChatRoomManager . class ) ) ) ; if ( man != null ) { ircchatRoomManagerUI = new IRCChatRoomManagerUI ( man ) ; <START_BUG> if ( ! ( ircchatRoomManagerUI . setup ( newClient , targetID , username ) ) ) <END_BUG> return ; } else { IPresenceContainer pc = ( ( IPresenceContainer ) ( newClient . getAdapter ( IPresenceContainer . class ) ) ) ; if ( pc != null ) { presenceContainerUI = new PresenceContainerUI ( pc ) ; presenceContainerUI . setup ( newClient , targetID , username ) ; } else { ISharedObjectContainer sharedObjectContainer = ( ( ISharedObjectContainer ) ( newClient . getAdapter ( ISharedObjectContainer . class ) ) ) ; if ( sharedObjectContainer != null ) { SharedObjectContainerUI socui = new SharedObjectContainerUI ( this , sharedObjectContainer ) ; socui . setup ( sharedObjectContainer , newClientEntry , resource , username ) ; } } } try { newClient . connect ( targetID , ConnectContextFactory . createUsernamePasswordConnectContext ( username , connectData ) ) ; } catch ( ContainerConnectException e ) { EclipseCollabSharedObject so = newClientEntry . getObject ( ) ; if ( so != null ) so . destroySelf ( ) ; throw e ; } CollabClient . addClientForResource ( newClientEntry , resource ) ; } public ClientEntry isConnected ( IResource project , String type ) { } protected static void addClientForResource ( ClientEntry entry , IResource proj ) { } protected static void removeClientForResource ( IResource proj , ID targetID ) { } public static String getNameForResource ( IResource res ) { } protected static IResource getWorkspace ( ) throws Exception { } protected static Vector getClientEntries ( IResource proj ) { } protected static ClientEntry getClientEntry ( IResource proj , ID targetID ) { } protected static ClientEntry getClientEntry ( IResource proj , String containerType ) { } protected static boolean containsEntry ( IResource proj , ID targetID ) { } public static synchronized ISharedObjectContainer getContainer ( IResource proj ) { } public static CollabClient getDefault ( ) { } protected synchronized void disposeClient ( IResource proj , ClientEntry entry ) { } protected String setupUsername ( ID targetID , String nickname ) throws URISyntaxException { } }

Fix:
if ( ircchatRoomManagerUI . setup ( newClient , targetID , username ) )