From fd532be9b69b18da133ec915d16bb9e4c0280774 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 29 Apr 2014 15:15:59 +0200 Subject: [PATCH] Fix unfiledEntries not updating If an roster push with a roster entry without any group is processed, then the entry is not updated, because unfiledEntries.contains(entry) would return true, as the RosterEntry.equals() method only compares the name. We simply fix it by always removing the entry first and then adding it again. Thanks to Christian Schudt for pointing this out. SMACK-559 --- smack-core/src/main/java/org/jivesoftware/smack/Roster.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/Roster.java b/smack-core/src/main/java/org/jivesoftware/smack/Roster.java index 811af170d..598f99f9c 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/Roster.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/Roster.java @@ -702,9 +702,8 @@ public class Roster { // Mark the entry as unfiled if it does not belong to any groups. if (item.getGroupNames().isEmpty()) { - if (!unfiledEntries.contains(entry)) { - unfiledEntries.add(entry); - } + unfiledEntries.remove(entry); + unfiledEntries.add(entry); } else { unfiledEntries.remove(entry);