Buggy code:
public class Client { public static final String JOIN_TIME_FORMAT = "hh:mm:ss<seq2seq4repair_space>a<seq2seq4repair_space>z" ; public static final String GENERIC_CONTAINER_CLIENT_NAME = "org.eclipse.ecf.provider.generic.Client" ; public static final String GENERIC_CONTAINER_SERVER_NAME = "org.eclipse.ecf.provider.generic.Server" ; public static final String DEFAULT_SERVER_ID = "ecftcp:////localhost:3282//server" ; public static final String COLLAB_SHARED_OBJECT_ID = "chat" ; public static final String FILE_DIRECTORY = "received_files" ; public static final String USERNAME = System . getProperty ( "user.name" ) ; public static final String ECFDIRECTORY = ( "ECF_" + ( Client . FILE_DIRECTORY ) ) + "//" ; public static final String WORKSPACE_NAME = "<workspace>" ; static ID defaultGroupID = null ; static Hashtable clients = new Hashtable ( ) ; public static String getNameForResource ( IResource res ) { } public static class ClientEntry { String type ; ISharedObjectContainer client ; EclipseCollabSharedObject obj ; public ClientEntry ( String type , ISharedObjectContainer cont ) { } public String getType ( ) { } public ISharedObjectContainer getContainer ( ) { } public void setObject ( EclipseCollabSharedObject obj ) { } public EclipseCollabSharedObject getObject ( ) { } public void dispose ( ) { } } protected static void addClientEntry ( IResource proj , Client . ClientEntry entry ) { } protected static Vector getClientEntries ( IResource proj ) { } protected static Client . ClientEntry getClientEntry ( IResource proj , String type ) { } protected static boolean containsEntry ( IResource proj , String type ) { } protected static void removeClientEntry ( IResource proj , String type ) { } public Client ( ) throws Exception { } protected User getUserData ( String containerType , ID clientID , String usernick , IResource project ) { } protected String getSharedFileDirectoryForProject ( IResource proj ) { } protected IResource getWorkspace ( ) throws Exception { } protected void makeAndAddSharedObject ( final Client . ClientEntry client , final IResource proj , User user , String fileDir ) throws Exception { } protected void addObjectToClient ( Client . ClientEntry client , String username , IResource proj ) throws Exception { } public synchronized Client . ClientEntry isConnected ( IResource project , String type ) { } public static boolean isType ( Client . ClientEntry entry , String type ) { } protected IJoinContext getJoinContext ( final String username , final Object password ) { } public synchronized void createAndConnectClient ( String type , final ID gID , String username , Object data , final IResource proj ) throws Exception { if ( proj == null ) throw new NullPointerException ( "Resource<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; Client . ClientEntry entry = Client . getClientEntry ( proj , type ) ; if ( entry != null ) { throw new ConnectException ( "Already<seq2seq4repair_space>connected" ) ; } String containerType = ( type == null ) ? Client . GENERIC_CONTAINER_CLIENT_NAME : type ; <START_BUG> final ISharedObjectContainer client = SharedObjectContainerFactory . makeSharedObjectContainer ( containerType ) ; <END_BUG> final Client . ClientEntry newClient = new Client . ClientEntry ( containerType , client ) ; final ID groupID = ( gID == null ) ? Client . defaultGroupID : gID ; if ( containerType . equals ( Client . GENERIC_CONTAINER_CLIENT_NAME ) ) { addObjectToClient ( newClient , username , proj ) ; } else { client . addListener ( new ISharedObjectContainerListener ( ) { public void handleEvent ( IContainerEvent evt ) { if ( evt instanceof ISharedObjectContainerDepartedEvent ) { ISharedObjectContainerDepartedEvent cd = ( ( ISharedObjectContainerDepartedEvent ) ( evt ) ) ; final ID departedContainerID = cd . getDepartedContainerID ( ) ; if ( groupID . equals ( departedContainerID ) ) { disposeClient ( proj , newClient ) ; } } } } , "" ) ; } IPresenceContainer pc = ( ( IPresenceContainer ) ( client . getAdapter ( IPresenceContainer . class ) ) ) ; if ( pc != null ) setupPresenceContainer ( client , pc , groupID , username ) ; try { client . joinGroup ( groupID , getJoinContext ( username , data ) ) ; } catch ( SharedObjectContainerJoinException e ) { try { EclipseCollabSharedObject so = newClient . getObject ( ) ; if ( so != null ) { so . destroySelf ( ) ; } } catch ( Exception e1 ) { } throw e ; } Client . addClientEntry ( proj , newClient ) ; } protected RosterView rosterView = null ; protected IMessageSender messageSender = null ; protected IPresenceSender presenceSender = null ; protected IAccountManager accountManager = null ; protected void setupPresenceContainer ( final ISharedObjectContainer container , IPresenceContainer pc , final ID localUser , final String nick ) { } public synchronized void disposeClient ( IResource proj , Client . ClientEntry entry ) { } public static synchronized ISharedObjectContainer getContainer ( IResource proj ) { } }

Fix:
final ISharedObjectContainer client = SharedObjectContainerFactory . getDefault ( ) . makeSharedObjectContainer ( containerType ) ;