Program: 104457
Project: 104457
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,each account has an index.
 */
public PresenceStatusSelectorBox(MainFrame mainFrame,ProtocolProviderService protocolProvider,int accountIndex){
  this.mainFrame=mainFrame;
  this.protocolProvider=protocolProvider;
  this.accountIndex=accountIndex;
  this.presence=mainFrame.getProtocolPresence(protocolProvider);
  this.statusIterator=this.presence.getSupportedStatusSet();
  String tooltip="String_Node_Str" + protocolProvider.getAccountID().getUserID() + "String_Node_Str";
  this.setToolTipText(tooltip);
  titleLabel=new JLabel(protocolProvider.getAccountID().getUserID());
  titleLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
  titleLabel.setFont(Constants.FONT.deriveFont(Font.BOLD));
  this.add(titleLabel);
  this.addSeparator();
  while (statusIterator.hasNext()) {
    PresenceStatus status=(PresenceStatus)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.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,each account has an index.
 */
public PresenceStatusSelectorBox(MainFrame mainFrame,ProtocolProviderService protocolProvider,int accountIndex){
  this.mainFrame=mainFrame;
  this.protocolProvider=protocolProvider;
  this.accountIndex=accountIndex;
  this.presence=mainFrame.getProtocolPresenceOpSet(protocolProvider);
  this.statusIterator=this.presence.getSupportedStatusSet();
  String tooltip="String_Node_Str" + protocolProvider.getAccountID().getUserID() + "String_Node_Str";
  this.setToolTipText(tooltip);
  titleLabel=new JLabel(protocolProvider.getAccountID().getUserID());
  titleLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
  titleLabel.setFont(Constants.FONT.deriveFont(Font.BOLD));
  this.add(titleLabel);
  this.addSeparator();
  while (statusIterator.hasNext()) {
    PresenceStatus status=(PresenceStatus)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.setSelectedStatus(offlineStatus);
}