Program: 103992
Project: 103992
Buggy source:
/** 
 * Creates an instance of <tt>StatusSelectorBox</tt> and initializes the selector box with data.
 * @param mainFrame The main application window.
 * @param protocolProvider The protocol provider.
 * @param accountIndex If we have more than one account for a protocol, eachaccount has an index.
 */
public PresenceStatusMenu(MainFrame mainFrame,ProtocolProviderService protocolProvider){
  super(protocolProvider.getAccountID().getDisplayName(),new ImageIcon(ImageLoader.getAccountStatusImage(protocolProvider)));
  this.protocolProvider=protocolProvider;
  this.mainFrame=mainFrame;
  this.presence=(OperationSetPresence)protocolProvider.getOperationSet(OperationSetPresence.class);
  this.statusIterator=this.presence.getSupportedStatusSet();
  String tooltip="String_Node_Str" + protocolProvider.getAccountID().getDisplayName() + "String_Node_Str";
  this.setToolTipText(tooltip);
  titleLabel=new JLabel(protocolProvider.getAccountID().getDisplayName());
  titleLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
  titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD));
  this.add(titleLabel);
  this.addSeparator();
  while (statusIterator.hasNext()) {
    PresenceStatus status=statusIterator.next();
    int connectivity=status.getStatus();
    if (connectivity < 1) {
      this.offlineStatus=status;
    }
 else     if ((onlineStatus != null && (onlineStatus.getStatus() < connectivity)) || (onlineStatus == null && (connectivity > 50 && connectivity < 80))) {
      this.onlineStatus=status;
    }
    this.addItem(status.getStatusName(),new ImageIcon(ImageLoader.getBytesInImage(status.getStatusIcon())),new ItemActionListener());
  }
  this.addSeparator();
  this.add(new StatusMessageMenu(protocolProvider));
  this.setSelectedStatus(offlineStatus);
}

Fixed version (ground truth):
/** 
 * Creates an instance of <tt>StatusSelectorBox</tt> and initializes the selector box with data.
 * @param mainFrame The main application window.
 * @param protocolProvider The protocol provider.
 * @param accountIndex If we have more than one account for a protocol, eachaccount has an index.
 */
public PresenceStatusMenu(MainFrame mainFrame,ProtocolProviderService protocolProvider){
  super(protocolProvider.getAccountID().getDisplayName(),new ImageIcon(ImageLoader.getAccountStatusImage(protocolProvider)));
  this.protocolProvider=protocolProvider;
  this.mainFrame=mainFrame;
  this.presence=(OperationSetPresence)protocolProvider.getOperationSet(OperationSetPresence.class);
  this.statusIterator=this.presence.getSupportedStatusSet();
  String tooltip="String_Node_Str" + protocolProvider.getAccountID().getDisplayName() + "String_Node_Str";
  this.setToolTipText(tooltip);
  titleLabel=new JLabel(protocolProvider.getAccountID().getDisplayName());
  titleLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
  titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD));
  this.add(titleLabel);
  this.addSeparator();
  while (statusIterator.hasNext()) {
    PresenceStatus status=statusIterator.next();
    int connectivity=status.getStatus();
    if (connectivity < 1) {
      this.offlineStatus=status;
    }
 else     if ((onlineStatus != null && (onlineStatus.getStatus() < connectivity)) || (onlineStatus == null && (connectivity > 50 && connectivity < 80))) {
      this.onlineStatus=status;
    }
    this.addItem(status.getStatusName(),new ImageIcon(status.getStatusIcon()),new ItemActionListener());
  }
  this.addSeparator();
  this.add(new StatusMessageMenu(protocolProvider));
  this.setSelectedStatus(offlineStatus);
}