Only fire RosterListener#entriesUpdated for RosterEntries that changed

Description

The RosterPacketListener adds roster entries to the list of updated entries without checking if the entry actually changed. This causes unnecessary notifications to the RosterListeners although there is no new information available for an entry.

The attached patch fixes this bug by implementeng a new #equalsDeep() method for RosterEntry which determines equality using all members of the RosterEntry class.
The RosterPacketListener now only adds the entry to the updated entries if #equalsDeep() compared with the old entry returns false.

Environment

None

Activity

Show:
Robin Collier
August 18, 2011, 2:14 PM

Apparently there are still issues with changing roster entries.

wroot
March 19, 2011, 11:30 AM
Walter Ebeling
March 11, 2011, 8:18 PM

Patch extended in rev 12087

Holger Bergunde
March 9, 2011, 3:32 PM

when i change the group name in spark with smack 2.3.0b2 the renamed group will disappear.
spark does the following:

RosterGroup rosterGroup = roster.getGroup(groupName);
if (rosterGroup != null) {
removeContactGroup(group);
rosterGroup.setName(newName);
}

the "deepquals" method of the RosterEntry doesn't seem to work properly. when the name is changed deepmethod says that the classes are equals even though they have different names!

Walter Ebeling
March 8, 2011, 5:13 PM

Roll back to a version prior the check in of this change allows a rename of groups

Cannot Reproduce
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

Henning Staib

Labels