Program: 94985
Project: 94985
Buggy source:
public void contactAdded(Contact contact){
  final MSNRosterEntry entry=new MSNRosterEntry(MSNContainer.this,contact,namespace);
  for (int i=0; i < entries.size(); i++) {
    Object e=entries.get(i);
    if (e instanceof MSNRosterGroup) {
      MSNRosterGroup group=(MSNRosterGroup)e;
      if (group.getGroup().contains(contact)) {
        MSNRosterEntry check=group.getEntryFor(contact);
        if (check == null) {
          check=entry;
          contact.addContactListener(new IContactListener(){
            public void nameChanged(            String name){
              fireRosterUpdate(entry);
              fireRosterEntryUpdated(entry);
            }
            public void personalMessageChanged(            String personalMessage){
              entry.updatePersonalMessage();
              fireRosterUpdate(entry);
              fireRosterEntryUpdated(entry);
            }
            public void statusChanged(            Status status){
              fireRosterUpdate(entry);
              fireRosterEntryUpdated(entry);
            }
          }
);
          group.add(check);
        }
        fireRosterUpdate(group);
        fireRosterEntryAdded(check);
        return;
      }
    }
 else {
      MSNRosterEntry check=(MSNRosterEntry)e;
      if (entry.getContact().equals(check.getContact())) {
        fireRosterEntryAdded(check);
        return;
      }
    }
  }
  entries.add(entry);
  entry.setParent(MSNContainer.this);
  fireRosterEntryAdded(entry);
}

Fixed version (ground truth):
public void contactAdded(Contact contact){
  final MSNRosterEntry entry=new MSNRosterEntry(MSNContainer.this,contact,namespace);
  for (int i=0; i < entries.size(); i++) {
    Object e=entries.get(i);
    if (e instanceof MSNRosterGroup) {
      MSNRosterGroup group=(MSNRosterGroup)e;
      if (group.getGroup().contains(contact)) {
        MSNRosterEntry check=group.getEntryFor(contact);
        if (check == null) {
          check=entry;
          contact.addContactListener(new IContactListener(){
            public void nameChanged(            String name){
              fireRosterUpdate(entry);
              fireRosterEntryUpdated(entry);
            }
            public void personalMessageChanged(            String personalMessage){
              entry.updatePersonalMessage();
              fireRosterUpdate(entry);
              fireRosterEntryUpdated(entry);
            }
            public void statusChanged(            Status status){
              fireRosterUpdate(entry);
              fireRosterEntryUpdated(entry);
            }
          }
);
          group.add(check);
        }
        fireRosterUpdate(group);
        fireRosterEntryAdded(check);
        return;
      }
    }
 else {
      MSNRosterEntry check=(MSNRosterEntry)e;
      if (entry.getContact().equals(check.getContact())) {
        fireRosterEntryAdded(check);
        return;
      }
    }
  }
  contact.addContactListener(new IContactListener(){
    public void nameChanged(    String name){
      fireRosterUpdate(entry);
      fireRosterEntryUpdated(entry);
    }
    public void personalMessageChanged(    String personalMessage){
      entry.updatePersonalMessage();
      fireRosterUpdate(entry);
      fireRosterEntryUpdated(entry);
    }
    public void statusChanged(    Status status){
      fireRosterUpdate(entry);
      fireRosterEntryUpdated(entry);
    }
  }
);
  entries.add(entry);
  entry.setParent(MSNContainer.this);
  fireRosterEntryAdded(entry);
}