Program: 103278
Project: 103278
Buggy source:
/** 
 * Called by joustsim as a notification of the fact that the server has sent the specified group and that it is actually a member from our contact list. We copy the group locally and generate the corresponding sip-communicator events
 * @param list the BuddyList where this is happening.
 * @param oldItems we don't use it
 * @param newItems we don't use it
 * @param group the new Group that has been added
 * @param buddies the members of the new group.
 */
public void groupAdded(BuddyList list,List<? extends Group> oldItems,List<? extends Group> newItems,Group group,List<? extends Buddy> buddies){
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + group.getName());
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + buddies);
  ContactGroupIcqImpl newGroup=findContactGroup(group.getName());
  if (newGroup == null) {
    newGroup=new ContactGroupIcqImpl((MutableGroup)group,buddies,ServerStoredContactListIcqImpl.this,true);
    rootGroup.addSubGroup(newGroup);
    fireGroupEvent(newGroup,ServerStoredGroupEvent.GROUP_CREATED_EVENT);
  }
 else {
    List<Contact> newContacts=new ArrayList<Contact>();
    List<ContactIcqImpl> deletedContacts=new ArrayList<ContactIcqImpl>();
    newGroup.updateGroup((MutableGroup)group,buddies,newContacts,deletedContacts);
    fireGroupEvent(newGroup,ServerStoredGroupEvent.GROUP_RESOLVED_EVENT);
    for (    ContactIcqImpl contact : deletedContacts)     fireContactRemoved(newGroup,contact);
    Iterator<Contact> contactsIter=newGroup.contacts();
    while (contactsIter.hasNext()) {
      Contact contact=contactsIter.next();
      if (newContacts.contains(contact))       fireContactAdded(newGroup,contact);
 else       fireContactResolved(newGroup,contact);
    }
  }
  for (  Buddy buddy : buddies)   buddy.addBuddyListener(jsimBuddyListener);
  group.addGroupListener(jsimGroupChangeListener);
}

Fixed version (ground truth):
/** 
 * Called by joustsim as a notification of the fact that the server has sent the specified group and that it is actually a member from our contact list. We copy the group locally and generate the corresponding sip-communicator events
 * @param list the BuddyList where this is happening.
 * @param oldItems we don't use it
 * @param newItems we don't use it
 * @param group the new Group that has been added
 * @param buddies the members of the new group.
 */
public void groupAdded(BuddyList list,List<? extends Group> oldItems,List<? extends Group> newItems,Group group,List<? extends Buddy> buddies){
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + group.getName());
  if (logger.isTraceEnabled())   logger.trace("String_Node_Str" + buddies);
  ContactGroupIcqImpl newGroup=findContactGroup(group.getName());
  if (newGroup == null) {
    newGroup=new ContactGroupIcqImpl((MutableGroup)group,buddies,ServerStoredContactListIcqImpl.this,true,true);
    rootGroup.addSubGroup(newGroup);
    fireGroupEvent(newGroup,ServerStoredGroupEvent.GROUP_CREATED_EVENT);
  }
 else {
    List<Contact> newContacts=new ArrayList<Contact>();
    List<ContactIcqImpl> deletedContacts=new ArrayList<ContactIcqImpl>();
    newGroup.updateGroup((MutableGroup)group,buddies,newContacts,deletedContacts);
    fireGroupEvent(newGroup,ServerStoredGroupEvent.GROUP_RESOLVED_EVENT);
    for (    ContactIcqImpl contact : deletedContacts)     fireContactRemoved(newGroup,contact);
    Iterator<Contact> contactsIter=newGroup.contacts();
    while (contactsIter.hasNext()) {
      Contact contact=contactsIter.next();
      if (newContacts.contains(contact))       fireContactAdded(newGroup,contact);
 else       fireContactResolved(newGroup,contact);
    }
  }
  for (  Buddy buddy : buddies)   buddy.addBuddyListener(jsimBuddyListener);
  group.addGroupListener(jsimGroupChangeListener);
}