Buggy code:
public class XMPPContainerPresenceHelper implements ISharedObject { public static final String VCARD = "vcard" ; public static final String VCARD_EMAIL = ( XMPPContainerPresenceHelper . VCARD ) + ".email" ; public static final String VCARD_EMAIL_HOME = ( XMPPContainerPresenceHelper . VCARD_EMAIL ) + ".home" ; public static final String VCARD_EMAIL_WORK = ( XMPPContainerPresenceHelper . VCARD_EMAIL ) + ".work" ; public static final String VCARD_NAME = ( XMPPContainerPresenceHelper . VCARD ) + ".name" ; public static final String VCARD_NAME_FIRST = ( XMPPContainerPresenceHelper . VCARD_NAME ) + ".first" ; public static final String VCARD_NAME_MIDDLE = ( XMPPContainerPresenceHelper . VCARD_NAME ) + ".middle" ; public static final String VCARD_NAME_LAST = ( XMPPContainerPresenceHelper . VCARD_NAME ) + ".last" ; public static final String VCARD_NAME_NICK = ( XMPPContainerPresenceHelper . VCARD_NAME ) + ".nick" ; public static final String VCARD_PHONE = ( XMPPContainerPresenceHelper . VCARD ) + ".phone" ; public static final String VCARD_PHONE_HOME = ( XMPPContainerPresenceHelper . VCARD_PHONE ) + ".home" ; public static final String VCARD_PHONE_HOME_VOICE = ( XMPPContainerPresenceHelper . VCARD_PHONE_HOME ) + ".voice" ; public static final String VCARD_PHONE_HOME_CELL = ( XMPPContainerPresenceHelper . VCARD_PHONE_HOME ) + ".cell" ; public static final String VCARD_PHONE_WORK = ( XMPPContainerPresenceHelper . VCARD_PHONE ) + ".work" ; public static final String VCARD_PHONE_WORK_VOICE = ( XMPPContainerPresenceHelper . VCARD_PHONE_WORK ) + ".voice" ; public static final String VCARD_PHONE_WORK_CELL = ( XMPPContainerPresenceHelper . VCARD_PHONE_WORK ) + ".cell" ; private ISharedObjectConfig config = null ; private final List sharedObjectMessageListeners = new ArrayList ( ) ; private XMPPContainer container = null ; private XMPPChatManager chatManager = null ; private final List presenceListeners = new ArrayList ( ) ; public XMPPContainerPresenceHelper ( XMPPContainer container ) { } public void init ( ISharedObjectConfig initData ) throws SharedObjectInitException { } public void handleEvent ( Event event ) { } public void handleEvents ( Event [ ] events ) { } public void disconnect ( ) { } public void dispose ( ID containerID ) { } public Object getAdapter ( Class adapter ) { } protected Roster roster ; protected XMPPContainerPresenceHelper . PresenceRosterManager rosterManager ; class PresenceRosterManager extends AbstractRosterManager { public PresenceRosterManager ( org . eclipse . ecf . presence . roster . Roster roster ) { } public void notifySubscriptionListener ( ID fromID , IPresence presence ) { } public void notifyRosterUpdate ( IRosterItem changedItem ) { } public void notifyRosterAdd ( IRosterEntry entry ) { } public void notifyRosterRemove ( IRosterEntry entry ) { } public void disconnect ( ) { } public void setUser ( IUser user ) { } IPresenceSender rosterPresenceSender = new IPresenceSender ( ) { public void sendPresenceUpdate ( ID toID , org . eclipse . ecf . presence . IPresence presence ) throws ECFException { } } ; public IPresenceSender getPresenceSender ( ) { } IRosterSubscriptionSender rosterSubscriptionSender = new IRosterSubscriptionSender ( ) { public void sendRosterAdd ( String user , String name , String [ ] groups ) throws ECFException { } public void sendRosterRemove ( ID userID ) throws ECFException { } } ; public IRosterSubscriptionSender getRosterSubscriptionSender ( ) { } public void addPresenceListener ( IPresenceListener listener ) { } public void removePresenceListener ( IPresenceListener listener ) { synchronized ( presenceListeners ) { <START_BUG> presenceListeners . add ( listener ) ; <END_BUG> } } } public IRosterManager getRosterManager ( ) { } public void setUser ( IUser user ) { } protected void addSharedObjectMessageListener ( ISharedObjectMessageListener listener ) { } protected void sendTypingMessage ( ID toID , boolean isTyping , String body ) throws IOException { } protected void handleSharedObjectMessageEvent ( ISharedObjectMessageEvent event ) { } protected void removeSharedObjectMessageListener ( ISharedObjectMessageListener listener ) { } private void addToRoster ( IRosterItem [ ] items ) { } protected ISharedObjectContext getContext ( ) { } protected String getUserNameFromXMPPAddress ( XMPPID userID ) { } protected IRosterEntry createRosterEntry ( RosterEntry entry ) { } protected IRosterEntry createRosterEntry ( XMPPID xmppid , RosterPacket . Item entry ) { } protected void handleIQEvent ( IQEvent evt ) { } protected void fireSetRosterEntry ( boolean remove , IRosterEntry entry ) { } private void removeItemFromRoster ( Collection rosterItems , XMPPID itemIDToRemove ) { } private boolean removeItemFromRosterGroup ( RosterGroup group , XMPPID itemIDToRemove ) { } protected void handleMessageEvent ( MessageEvent evt ) { } protected void handlePresenceEvent ( PresenceEvent evt ) { } private void firePresenceListeners ( ID fromID , IPresence presence ) { } private void updatePresence ( XMPPID fromID , IPresence newPresence ) { } class AdditionalClientRosterEntry { IRosterItem parent ; IUser user ; IPresence presence ; public AdditionalClientRosterEntry ( IRosterItem parent , IUser user , IPresence presence ) { } } private XMPPContainerPresenceHelper . AdditionalClientRosterEntry updatePresenceForMatchingEntry ( org . eclipse . ecf . presence . roster . RosterEntry entry , XMPPID fromID , IPresence newPresence ) { } private XMPPContainerPresenceHelper . AdditionalClientRosterEntry [ ] updatePresenceInGroup ( IRosterGroup group , XMPPID fromID , IPresence newPresence ) { } protected void handleRoster ( Roster roster ) { } protected XMPPID createIDFromName ( String uname ) { } protected ID createThreadID ( String thread ) { } private final Map vcardCache = new WeakHashMap ( ) ; private VCard getFromCache ( String id ) { } private void addToCache ( String id , VCard card ) { } private VCard getVCardForPresence ( Presence xmppPresence ) { } private Map addVCardProperties ( VCard vcard , Map props ) { } class XMPPPresence extends org . eclipse . ecf . presence . Presence { private static final long serialVersionUID = 7843634971520771692L ; IFuture asyncResult = null ; String fromID = null ; XMPPPresence ( String fromID , Presence xmppPresence , IFuture future ) { } private void fillFromVCard ( ) { } public byte [ ] getPictureData ( ) { } public Map getProperties ( ) { } } protected IPresence createIPresence ( final Presence xmppPresence ) { } protected Presence createPresence ( IPresence ipresence ) { } protected Mode createIPresenceMode ( Presence xmppPresence ) { } protected Mode createPresenceMode ( IPresence ipresence ) { } protected Type createIPresenceType ( Presence xmppPresence ) { }

Fix:
presenceListeners . remove ( listener ) ;