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


#1

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:

  https://github.com/jitsi/jitsi/pull/185

-- Commit Summary --

  * Fixing TreeSet's Comparator

-- File Changes --

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

-- Patch Links --

https://github.com/jitsi/jitsi/pull/185.patch
https://github.com/jitsi/jitsi/pull/185.diff

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi/pull/185


#2

Merged #185.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi/pull/185#event-467777521


#3

Thanks!

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi/pull/185#issuecomment-157672067