The comparison method for sorting geocache logs is badly written. TimSort implementation in Android SDK can verify wheres x.compareTo(y) == 0 == y.compareTo(x). If this is not met, it throws IllegalArgumentException:
Non-fatal Exception: java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeLo(TimSort.java:743)
at java.util.TimSort.mergeAt(TimSort.java:479)
at java.util.TimSort.mergeForceCollapse(TimSort.java:422)
at java.util.TimSort.sort(TimSort.java:219)
at java.util.TimSort.sort(TimSort.java:169)
at java.util.Arrays.sort(Arrays.java:2010)
at java.util.Collections.sort(Collections.java:1883)
at locus.api.mapper.GeocacheLogConverter.sortLocusGeocachingLogsByDate(SourceFile:5124)
at com.arcao.geocaching4locus.update.task.UpdateTask.locus.api.mapper.DataMapper.addCacheLogs(SourceFile:3050)
at com.arcao.geocaching4locus.update.task.UpdateTask.doInBackground(SourceFile:42)
The comparison method for sorting geocache logs is badly written. TimSort implementation in Android SDK can verify wheres
x.compareTo(y) == 0 == y.compareTo(x)
. If this is not met, it throwsIllegalArgumentException
: