mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 18:48:00 +01:00
Make Roster.unfiledEntries a CopyOnWriteArraySet
This commit is contained in:
parent
bb85d2b437
commit
0581580831
1 changed files with 5 additions and 6 deletions
|
@ -30,7 +30,7 @@ import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArraySet;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ public class Roster extends Manager {
|
||||||
private RosterStore rosterStore;
|
private RosterStore rosterStore;
|
||||||
private final Map<String, RosterGroup> groups = new ConcurrentHashMap<String, RosterGroup>();
|
private final Map<String, RosterGroup> groups = new ConcurrentHashMap<String, RosterGroup>();
|
||||||
private final Map<String,RosterEntry> entries = new ConcurrentHashMap<String,RosterEntry>();
|
private final Map<String,RosterEntry> entries = new ConcurrentHashMap<String,RosterEntry>();
|
||||||
private final List<RosterEntry> unfiledEntries = new CopyOnWriteArrayList<RosterEntry>();
|
private final Set<RosterEntry> unfiledEntries = new CopyOnWriteArraySet<>();
|
||||||
private final Set<RosterListener> rosterListeners = new LinkedHashSet<>();
|
private final Set<RosterListener> rosterListeners = new LinkedHashSet<>();
|
||||||
private final Map<String, Map<String, Presence>> presenceMap = new ConcurrentHashMap<String, Map<String, Presence>>();
|
private final Map<String, Map<String, Presence>> presenceMap = new ConcurrentHashMap<String, Map<String, Presence>>();
|
||||||
|
|
||||||
|
@ -496,13 +496,13 @@ public class Roster extends Manager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an unmodifiable collection for the unfiled roster entries. An unfiled entry is
|
* Returns an unmodifiable set for the unfiled roster entries. An unfiled entry is
|
||||||
* an entry that doesn't belong to any groups.
|
* an entry that doesn't belong to any groups.
|
||||||
*
|
*
|
||||||
* @return the unfiled roster entries.
|
* @return the unfiled roster entries.
|
||||||
*/
|
*/
|
||||||
public List<RosterEntry> getUnfiledEntries() {
|
public Set<RosterEntry> getUnfiledEntries() {
|
||||||
return Collections.unmodifiableList(unfiledEntries);
|
return Collections.unmodifiableSet(unfiledEntries);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -924,7 +924,6 @@ public class Roster extends Manager {
|
||||||
|
|
||||||
// Mark the entry as unfiled if it does not belong to any groups.
|
// Mark the entry as unfiled if it does not belong to any groups.
|
||||||
if (item.getGroupNames().isEmpty()) {
|
if (item.getGroupNames().isEmpty()) {
|
||||||
unfiledEntries.remove(entry);
|
|
||||||
unfiledEntries.add(entry);
|
unfiledEntries.add(entry);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue