Buggy code:
public class IRCRootContainer extends IRCAbstractContainer implements IChatRoomContainer , IChatRoomContainerOptionsAdapter , IChatRoomInvitationSender , IChatRoomManager , IContainer , IRCMessageChannel , IChatMessageSender { private static final long CONNECT_TIMEOUT = 20000 ; protected IRCConnection connection = null ; protected IRCRootContainer . ReplyHandler replyHandler = null ; protected Map channels = new HashMap ( ) ; protected String username ; protected String encoding = null ; private ArrayList invitationListeners ; protected Object connectLock = new Object ( ) ; protected boolean connectWaiting = false ; protected Exception connectException = null ; public IRCRootContainer ( ID localID ) throws IDCreateException { } public void connect ( ID connectID , IConnectContext connectContext ) throws ContainerConnectException { if ( ( connection ) != null ) throw new ContainerConnectException ( Messages . IRCRootContainer_Exception_Already_Connected ) ; if ( connectID == null ) throw new ContainerConnectException ( Messages . IRCRootContainer_Exception_TargetID_Null ) ; if ( ! ( connectID instanceof IRCID ) ) throw new ContainerConnectException ( NLS . bind ( IRCRootContainer_Exception_TargetID_Wrong_Type , new Object [ ] { targetID , IRCID . class . getName ( ) } ) ) ; if ( connectWaiting ) throw new ContainerConnectException ( Messages . IRCRootContainer_Connecting ) ; fireContainerEvent ( new ContainerConnectingEvent ( this . getID ( ) , connectID , connectContext ) ) ; String pw = getPasswordFromConnectContext ( connectContext ) ; IRCID tID = ( ( IRCID ) ( connectID ) ) ; String host = tID . getHost ( ) ; int port = tID . getPort ( ) ; String pass = pw ; String nick = tID . getUser ( ) ; String user = nick ; this . username = user ; String name = null ; boolean ssl = false ; if ( ! ssl ) { connection = new IRCConnection ( host , new int [ ] { port } , pass , nick , user , name ) ; } else { connection = new SSLIRCConnection ( host , new int [ ] { port } , pass , nick , user , name ) ; } connection . addIRCEventListener ( getIRCEventListener ( ) ) ; connection . setPong ( true ) ; connection . setDaemon ( false ) ; connection . setColors ( true ) ; if ( ( encoding ) != null ) connection . setEncoding ( encoding ) ; trace ( ( ( Messages . IRCRootContainer_Connecting_To ) + ( targetID ) ) ) ; synchronized ( connectLock ) { connectWaiting = true ; connectException = null ; try { connection . connect ( ) ; long timeout = ( IRCRootContainer . CONNECT_TIMEOUT ) + ( System . currentTimeMillis ( ) ) ; while ( ( connectWaiting ) && ( timeout > ( System . currentTimeMillis ( ) ) ) ) { connectLock . wait ( 2000 ) ; } if ( connectWaiting ) <START_BUG> throw new org . eclipse . ecf . core . util . TimeoutException ( IRCRootContainer . CONNECT_TIMEOUT , NLS . bind ( IRCRootContainer_Connect_Timeout , tID . getName ( ) ) ) ; <END_BUG> if ( ( connectException ) != null ) throw connectException ; this . targetID = tID ; fireContainerEvent ( new ContainerConnectedEvent ( getID ( ) , this . targetID ) ) ; } catch ( Exception e ) { this . targetID = null ; throw new ContainerConnectException ( NLS . bind ( IRCRootContainer_Exception_Connect_Failed , connectID . getName ( ) ) , e ) ; } finally { connectWaiting = false ; connectException = null ; } } } protected void handleDisconnected ( ) { } protected void handleErrorIfConnecting ( String message ) { } protected IRCEventListener getIRCEventListener ( ) { } protected String getIRCUserName ( IRCUser user ) { } public void disconnect ( ) { } public Object getAdapter ( Class serviceType ) { } public Namespace getConnectNamespace ( ) { } public IChatRoomInfo getChatRoomInfo ( final String roomName ) { } public IChatRoomInfo [ ] getChatRoomInfos ( ) { } public IChatRoomManager [ ] getChildren ( ) { } public IChatRoomManager getParent ( ) { } public void addChatRoomParticipantListener ( IChatRoomParticipantListener participantListener ) { } public void removeChatRoomParticipantListener ( IChatRoomParticipantListener participantListener ) { } public IChatRoomMessageSender getChatRoomMessageSender ( ) { } protected String nextToken ( StringBuffer buffer ) { } protected void parseCommandAndSend ( String commandMessage , String channelName , String ircUser ) { } private synchronized void handleCommandMessage ( String [ ] tokens , String channelName ) { } protected void handleInvite ( ID channelID , ID fromID ) { } protected IRCChannelContainer getChannel ( String channel ) { } protected void showMessage ( String channel , String msg ) { } protected void showMessage ( String channel , String user , String msg ) { } void showErrorMessage ( String channel , String msg ) { } ID getSystemID ( ) { } protected void handle353Reply ( String channel , String [ ] strings ) { } protected class ReplyHandler { public void handleReply ( int code , String arg1 , String arg2 ) { } private String trimUsername ( String un ) { } } protected void handleSetSubject ( String channelName , IRCUser user , String newSubject ) { } protected void doJoinChannel ( String channelName , String key ) { } protected void doPartChannel ( String channelName ) { } protected void doSendChannelMessage ( String channelName , String ircUser , String msg ) { } protected void doSendSubjectChangeMessage ( String channelName , String topic ) throws ECFException { } protected void addChannel ( String channel , IRCChannelContainer container ) { } protected IRCChannelContainer getContainerForChannel ( String channel ) { } protected void removeChannel ( String channel ) { } public boolean setEncoding ( String encoding ) { } public void addInvitationListener ( IChatRoomInvitationListener listener ) { } public void removeInvitationListener ( IChatRoomInvitationListener listener ) { } public IChatRoomInfo createChatRoom ( String roomname , Map properties ) throws ChatRoomCreateException { } protected IHistoryManager chatRoomHistoryManager = new IHistoryManager ( ) { public IHistory getHistory ( ID chatRoomID , Map options ) { }

Fix:
throw new org . eclipse . ecf . core . util . TimeoutException ( NLS . bind ( IRCRootContainer_Connect_Timeout , tID . getName ( ) ) , IRCRootContainer . CONNECT_TIMEOUT ) ;