Program: 95232
Project: 95232
Buggy source:
protected void setupPresenceContainer(final ISharedObjectContainer container,IPresenceContainer pc,final ID localUser,final String nick){
  messageSender=pc.getMessageSender();
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      try {
        IWorkbenchWindow ww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        IWorkbenchPage wp=ww.getActivePage();
        IViewPart view=wp.showView("String_Node_Str");
        rosterView=(RosterView)view;
        String nickname=null;
        if (nick != null) {
          nickname=nick;
        }
 else {
          String name=localUser.getName();
          nickname=name.substring(0,name.indexOf("String_Node_Str"));
        }
        rosterView.setLocalUser(new org.eclipse.ecf.core.user.User(localUser,nickname),new ITextInputHandler(){
          public void handleTextLine(          ID userID,          String text){
            messageSender.sendMessage(localUser,userID,null,null,text);
          }
          public void handleStartTyping(          ID userID){
          }
          public void disconnect(){
            container.leaveGroup();
          }
        }
);
      }
 catch (      Exception e) {
        IStatus status=new Status(IStatus.ERROR,ClientPlugin.PLUGIN_ID,IStatus.OK,"String_Node_Str",e);
        ClientPlugin.getDefault().getLog().log(status);
      }
    }
  }
);
  pc.addMessageListener(new IMessageListener(){
    public void handleMessage(    final ID fromID,    final ID toID,    final Type type,    final String subject,    final String message){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          rosterView.handleMessage(fromID,toID,type,subject,message);
        }
      }
);
    }
  }
);
  pc.addPresenceListener(new IPresenceListener(){
    public void handleContainerJoined(    final ID joinedContainer){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          rosterView.setGroup(joinedContainer);
        }
      }
);
    }
    public void handleRosterEntry(    final IRosterEntry entry){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          rosterView.handleRosterEntry(entry);
        }
      }
);
    }
    public void handlePresence(    final ID fromID,    final IPresence presence){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          rosterView.handlePresence(fromID,presence);
        }
      }
);
    }
    public void handleContainerDeparted(    final ID departedContainer){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          if (rosterView != null) {
            rosterView.memberDeparted(departedContainer);
          }
        }
      }
);
      messageSender=null;
      rosterView=null;
    }
  }
);
  pc.addSubscribeListener(new ISubscribeListener(){
    public void handleSubscribeRequest(    ID fromID,    IPresence presence){
      System.out.println("String_Node_Str" + fromID);
      if (messageSender != null) {
        messageSender.sendPresenceUpdate(localUser,fromID,new Presence(IPresence.Type.SUBSCRIBED));
      }
    }
    public void handleUnsubscribeRequest(    ID fromID,    IPresence presence){
      System.out.println("String_Node_Str" + fromID);
    }
    public void handleSubscribed(    ID fromID,    IPresence presence){
      System.out.println("String_Node_Str" + fromID);
    }
    public void handleUnsubscribed(    ID fromID,    IPresence presence){
      System.out.println("String_Node_Str" + fromID);
    }
  }
);
}

Fixed version (ground truth):
protected void setupPresenceContainer(final ISharedObjectContainer container,IPresenceContainer pc,final ID localUser,final String nick){
  messageSender=pc.getMessageSender();
  presenceSender=pc.getPresenceSender();
  accountManager=pc.getAccountManager();
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      try {
        IWorkbenchWindow ww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        IWorkbenchPage wp=ww.getActivePage();
        IViewPart view=wp.showView("String_Node_Str");
        rosterView=(RosterView)view;
        String nickname=null;
        if (nick != null) {
          nickname=nick;
        }
 else {
          String name=localUser.getName();
          nickname=name.substring(0,name.indexOf("String_Node_Str"));
        }
        rosterView.setLocalUser(new org.eclipse.ecf.core.user.User(localUser,nickname),new ITextInputHandler(){
          public void handleTextLine(          ID userID,          String text){
            messageSender.sendMessage(localUser,userID,null,null,text);
          }
          public void handleStartTyping(          ID userID){
          }
          public void disconnect(){
            container.leaveGroup();
          }
        }
);
      }
 catch (      Exception e) {
        IStatus status=new Status(IStatus.ERROR,ClientPlugin.PLUGIN_ID,IStatus.OK,"String_Node_Str",e);
        ClientPlugin.getDefault().getLog().log(status);
      }
    }
  }
);
  pc.addMessageListener(new IMessageListener(){
    public void handleMessage(    final ID fromID,    final ID toID,    final Type type,    final String subject,    final String message){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          rosterView.handleMessage(fromID,toID,type,subject,message);
        }
      }
);
    }
  }
);
  pc.addPresenceListener(new IPresenceListener(){
    public void handleContainerJoined(    final ID joinedContainer){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          rosterView.setGroup(joinedContainer);
        }
      }
);
    }
    public void handleRosterEntry(    final IRosterEntry entry){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          rosterView.handleRosterEntry(entry);
        }
      }
);
    }
    public void handlePresence(    final ID fromID,    final IPresence presence){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          rosterView.handlePresence(fromID,presence);
        }
      }
);
    }
    public void handleContainerDeparted(    final ID departedContainer){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          if (rosterView != null) {
            rosterView.memberDeparted(departedContainer);
          }
        }
      }
);
      messageSender=null;
      rosterView=null;
    }
  }
);
  pc.addSubscribeListener(new ISubscribeListener(){
    public void handleSubscribeRequest(    ID fromID,    IPresence presence){
      System.out.println("String_Node_Str" + fromID);
      if (presenceSender != null) {
        presenceSender.sendPresenceUpdate(localUser,fromID,new Presence(IPresence.Type.SUBSCRIBED));
      }
    }
    public void handleUnsubscribeRequest(    ID fromID,    IPresence presence){
      System.out.println("String_Node_Str" + fromID);
    }
    public void handleSubscribed(    ID fromID,    IPresence presence){
      System.out.println("String_Node_Str" + fromID);
    }
    public void handleUnsubscribed(    ID fromID,    IPresence presence){
      System.out.println("String_Node_Str" + fromID);
    }
  }
);
}