Program: 94807
Project: 94807
Buggy source:
/** 
 * @param adapters
 */
private void chooseAccount(final IContainer[] containers){
  if (containers.length == 1) {
    openContainer(containers[0]);
    return;
  }
 else {
    final IPresenceContainerAdapter[] adapters=new IPresenceContainerAdapter[containers.length];
    for (int i=0; i < containers.length; i++)     adapters[i]=(IPresenceContainerAdapter)containers[i].getAdapter(IPresenceContainerAdapter.class);
    ListDialog dialog=new ListDialog(null);
    dialog.setContentProvider(new IStructuredContentProvider(){
      public Object[] getElements(      Object inputElement){
        return adapters;
      }
      public void dispose(){
      }
      public void inputChanged(      Viewer viewer,      Object oldInput,      Object newInput){
      }
    }
);
    dialog.setInput(adapters);
    dialog.setAddCancelButton(true);
    dialog.setBlockOnOpen(true);
    dialog.setTitle(Messages.XMPPHyperlink_SELECT_ACCOUNT_TITLE);
    dialog.setMessage(Messages.XMPPHyperlink_SELECT_ACCOUNT_MESSAGE);
    dialog.setHeightInChars(adapters.length > 4 ? adapters.length : 4);
    dialog.setInitialSelections(new IPresenceContainerAdapter[]{adapters[0]});
    dialog.setLabelProvider(new ILabelProvider(){
      public Image getImage(      Object element){
        return null;
      }
      public String getText(      Object element){
        IRosterManager manager=((IPresenceContainerAdapter)element).getRosterManager();
        if (manager == null)         return null;
        return manager.getRoster().getUser().getID().getName();
      }
      public void addListener(      ILabelProviderListener listener){
      }
      public void dispose(){
      }
      public boolean isLabelProperty(      Object element,      String property){
        return false;
      }
      public void removeListener(      ILabelProviderListener listener){
      }
    }
);
    int result=dialog.open();
    if (result == ListDialog.OK) {
      Object[] res=dialog.getResult();
      if (res.length > 0)       openContainer((IContainer)res[0]);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param adapters
 */
private void chooseAccount(final IContainer[] containers){
  if (containers.length == 1) {
    openContainer(containers[0]);
    return;
  }
 else {
    final IPresenceContainerAdapter[] adapters=new IPresenceContainerAdapter[containers.length];
    for (int i=0; i < containers.length; i++)     adapters[i]=(IPresenceContainerAdapter)containers[i].getAdapter(IPresenceContainerAdapter.class);
    final ListDialog dialog=new ListDialog(null);
    dialog.setContentProvider(new IStructuredContentProvider(){
      public Object[] getElements(      Object inputElement){
        return adapters;
      }
      public void dispose(){
      }
      public void inputChanged(      Viewer viewer,      Object oldInput,      Object newInput){
      }
    }
);
    dialog.setInput(adapters);
    dialog.setAddCancelButton(true);
    dialog.setBlockOnOpen(true);
    dialog.setTitle(Messages.XMPPHyperlink_SELECT_ACCOUNT_TITLE);
    dialog.setMessage(Messages.XMPPHyperlink_SELECT_ACCOUNT_MESSAGE);
    dialog.setHeightInChars(adapters.length > 4 ? adapters.length : 4);
    dialog.setInitialSelections(new IPresenceContainerAdapter[]{adapters[0]});
    dialog.setLabelProvider(new ILabelProvider(){
      public Image getImage(      Object element){
        return null;
      }
      public String getText(      Object element){
        final IRosterManager manager=((IPresenceContainerAdapter)element).getRosterManager();
        if (manager == null)         return null;
        return manager.getRoster().getUser().getID().getName();
      }
      public void addListener(      ILabelProviderListener listener){
      }
      public void dispose(){
      }
      public boolean isLabelProperty(      Object element,      String property){
        return false;
      }
      public void removeListener(      ILabelProviderListener listener){
      }
    }
);
    final int result=dialog.open();
    if (result == ListDialog.OK) {
      final Object[] res=dialog.getResult();
      if (res.length > 0)       openContainer((IContainer)res[0]);
    }
  }
}