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 { IWorkbenchWindow ww = PlatformUI . getWorkbench ( ) . getActiveWorkbenchWindow ( ) ; EclipseCollabSharedObject sharedObject = new EclipseCollabSharedObject ( proj , ww , user , fileDir ) ; sharedObject . setListener ( new SharedObjectEventListener ( ) { public void memberRemoved ( ID member ) { ID groupID = client . getContainer ( ) . getGroupID ( ) ; if ( member . equals ( groupID ) ) { disposeClient ( proj , client ) ; } } public void memberAdded ( ID member ) { } public void otherActivated ( ID other ) { } public void otherDeactivated ( ID other ) { } public void windowClosing ( ) { Client . removeClientEntry ( proj , client . getType ( ) ) ; } } ) ; ID newID = IDFactory . makeStringID ( Client . COLLAB_SHARED_OBJECT_ID ) ; <START_BUG> client . getContainer ( ) . getSharedObjectManager ( ) . addSharedObject ( newID , sharedObject , new HashMap ( ) , null ) ; <END_BUG> client . setObject ( sharedObject ) ; } 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 { } 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:
client . getContainer ( ) . getSharedObjectManager ( ) . addSharedObject ( newID , sharedObject , new HashMap ( ) ) ;