[jitsi-dev] [jitsi] Fix TreeSet's Comparator in Jabber Presence class (#185)


This fixes the Presence TreeSet's Comparator. If the comparator can't
determine a greater or less than relationship, it will sort by the name
of the resources lexicographically.
A (mathematical) set is a collection of distinct objects. A TreeSet's
compare function determines relation of two objects. It also determines
equality and since this is a Set, it would effectively replace the old
one in the set, if the function returns 0. This method wasn't fully
equals consistent, meaning different objects were deemed equal by the
comparator. That lead to an inconsistency in the representation of
presence objects and resources that contact has connected. The resources
not represented in this TreeSet would no longer be able to let the
contact appear as Online.

This resolves #182
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * Fixing TreeSet's Comparator

-- File Changes --

    M src/net/java/sip/communicator/impl/protocol/jabber/OperationSetPersistentPresenceJabberImpl.java (13)

-- Patch Links --



Reply to this email directly or view it on GitHub:


Merged #185.


Reply to this email directly or view it on GitHub:




Reply to this email directly or view it on GitHub: