Buggy code:
public class PublishedGraphTracker implements ISharedObject { private static final ID [ ] NO_GRAPHS = new ID [ ] { } ; private static final int ADD = 0 ; private static final int REMOVE = 1 ; private static final int LEAVE = 2 ; private static final String ARG_TABLE = "table" ; private class Table { private final Hashtable graphs = new Hashtable ( ) ; private final Hashtable containers = new Hashtable ( ) ; public synchronized void add ( ID containerID , ID graphID ) { } public synchronized void remove ( ID containerID , ID graphID ) { } public synchronized void remove ( ID containerID ) { } public synchronized boolean contains ( ID graphID ) { } public synchronized ID [ ] getGraphs ( ID containerID ) { } public synchronized Object createMemento ( ) { } public synchronized void load ( Object memento ) { } } private final PublishedGraphTracker . Table table = new PublishedGraphTracker . Table ( ) ; private ISharedObjectConfig config ; private ISharedObjectContext context ; private final Object activationMutex = new Object ( ) ; private boolean activated ; public synchronized void add ( ID graphID ) throws ECFException { } public synchronized boolean isPublished ( ID graphID ) { } public synchronized void init ( ISharedObjectConfig initData ) throws SharedObjectInitException { } public void handleEvent ( Event event ) { if ( event instanceof ISharedObjectMessageEvent ) { ISharedObjectMessageEvent e = ( ( ISharedObjectMessageEvent ) ( event ) ) ; Object [ ] data = ( ( Object [ ] ) ( e . getData ( ) ) ) ; Integer type = ( ( Integer ) ( data [ 0 ] ) ) ; switch ( type . intValue ( ) ) { case PublishedGraphTracker . ADD : handleAdd ( e . getRemoteContainerID ( ) , ( ( ID ) ( data [ 1 ] ) ) ) ; break ; case PublishedGraphTracker . REMOVE : handleRemove ( e . getRemoteContainerID ( ) , ( ( ID ) ( data [ 1 ] ) ) ) ; break ; case PublishedGraphTracker . LEAVE : handleLeave ( e . getRemoteContainerID ( ) ) ; break ; } } else if ( event instanceof ISharedObjectContainerJoinedEvent ) { ISharedObjectContainerJoinedEvent e = ( ( ISharedObjectContainerJoinedEvent ) ( event ) ) ; if ( e . getJoinedContainerID ( ) . equals ( getContext ( ) . getLocalContainerID ( ) ) ) handleJoined ( ) ; else <START_BUG> if ( getContext ( ) . isGroupServer ( ) ) <END_BUG> handleJoined ( e . getJoinedContainerID ( ) ) ; } else if ( event instanceof ISharedObjectContainerDepartedEvent ) { ISharedObjectContainerDepartedEvent e = ( ( ISharedObjectContainerDepartedEvent ) ( event ) ) ; if ( ! ( e . getDepartedContainerID ( ) . equals ( getContext ( ) . getLocalContainerID ( ) ) ) ) handleLeave ( e . getDepartedContainerID ( ) ) ; } else if ( event instanceof ISharedObjectActivatedEvent ) { ISharedObjectActivatedEvent e = ( ( ISharedObjectActivatedEvent ) ( event ) ) ; if ( e . getActivatedID ( ) . equals ( config . getSharedObjectID ( ) ) ) handleActivated ( ) ; } else if ( event instanceof ISharedObjectDeactivatedEvent ) { ISharedObjectDeactivatedEvent e = ( ( ISharedObjectDeactivatedEvent ) ( event ) ) ; if ( e . getDeactivatedID ( ) . equals ( config . getSharedObjectID ( ) ) ) handleDeactivated ( ) ; else if ( table . contains ( e . getDeactivatedID ( ) ) ) handleRemoved ( e . getDeactivatedID ( ) ) ; } } private void handleAdd ( ID containerID , ID graphID ) { } private void handleRemove ( ID containerID , ID graphID ) { } private void handleLeave ( ID containerID ) { } private void handleJoined ( ) { } private void handleJoined ( ID containerID ) { } private void handleActivated ( ) { } private void handleDeactivated ( ) { } private void handleRemoved ( ID graphID ) { } public void handleEvents ( Event [ ] events ) { } public synchronized void dispose ( ID containerID ) { } public Object getAdapter ( Class adapter ) { } private ISharedObjectContext getContext ( ) { } }

Fix:
if ( getContext ( ) . isGroupManager ( ) )