aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/metahistory
diff options
context:
space:
mode:
authorIngo Bauersachs <ingo@jitsi.org>2014-11-27 16:02:25 +0100
committerIngo Bauersachs <ingo@jitsi.org>2014-11-27 16:14:50 +0100
commit80ea5390e3c15d179188c48d0c0b3504cf657609 (patch)
tree5be6212371b369900eb9771fd60862576bddbb3a /src/net/java/sip/communicator/impl/metahistory
parent32de2595ac51308df94043d8f99008d8cebe9915 (diff)
downloadjitsi-80ea5390e3c15d179188c48d0c0b3504cf657609.zip
jitsi-80ea5390e3c15d179188c48d0c0b3504cf657609.tar.gz
jitsi-80ea5390e3c15d179188c48d0c0b3504cf657609.tar.bz2
Remove most pre-sorting in the history service to avoid eliminations.
The sorting introduced in commit 4c665742027d7e89f0c136d1e30ea946be2a1c0f didn't take into account that TreeSet mandates that the ordering "...must be consistent with equals if it is to correctly implement the Set interface.". This was not the case as the comparator only checks for the timestamp of a history event and as such it can have two or more events at exactly the same time (and thus ordering) which would be overwritten in the resulting set.
Diffstat (limited to 'src/net/java/sip/communicator/impl/metahistory')
-rw-r--r--src/net/java/sip/communicator/impl/metahistory/MetaHistoryServiceImpl.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/impl/metahistory/MetaHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/metahistory/MetaHistoryServiceImpl.java
index 78dac57..c8f3543 100644
--- a/src/net/java/sip/communicator/impl/metahistory/MetaHistoryServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/metahistory/MetaHistoryServiceImpl.java
@@ -199,7 +199,7 @@ public class MetaHistoryServiceImpl
MessageProgressWrapper listenWrapper
= new MessageProgressWrapper(services.length);
- TreeSet<Object> result = new TreeSet<Object>(new RecordsComparator());
+ LinkedList<Object> result = new LinkedList<Object>();
for (int i = 0; i < services.length; i++)
{
String name = services[i];
@@ -244,6 +244,7 @@ public class MetaHistoryServiceImpl
}
listenWrapper.fireLastProgress(startDate, endDate, null);
+ Collections.sort(result, new RecordsComparator());
return result;
}