Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Piché2019-06-10 16:20:05 -0400
committerMatthew Khouzam2019-06-12 19:30:28 -0400
commite59f68e3de1c2e770d21f8a05ad330271c03ea06 (patch)
treea2b3ed3702f5d1c9b5caf06ad23329e642fa8da7
parent5454aa6299928087dacd644b280ff17839acceef (diff)
downloadorg.eclipse.tracecompass-e59f68e3de1c2e770d21f8a05ad330271c03ea06.tar.gz
org.eclipse.tracecompass-e59f68e3de1c2e770d21f8a05ad330271c03ea06.tar.xz
org.eclipse.tracecompass-e59f68e3de1c2e770d21f8a05ad330271c03ea06.zip
tmf: fix reversed sort
When using -x.compareTo(y) for descending order, if x = 0b100000, then -x equals 0b100000. Use y.compareTo(x) for safe sort. Change-Id: I9d94b367d89344672346330280f2af49ff0a7de6 Signed-off-by: David Piché <david.piche@ericsson.com> Reviewed-on: https://git.eclipse.org/r/143644 Tested-by: CI Bot Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Reviewed-by: Simon Delisle <simon.delisle@ericsson.com> Tested-by: Simon Delisle <simon.delisle@ericsson.com>
-rw-r--r--tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/project/model/TmfTraceType.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/project/model/TmfTraceType.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/project/model/TmfTraceType.java
index ebf03f0c80..1f73cb8f01 100644
--- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/project/model/TmfTraceType.java
+++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/project/model/TmfTraceType.java
@@ -479,7 +479,7 @@ public final class TmfTraceType {
public static @NonNull List<TraceTypeHelper> selectTraceType(String path, String traceTypeHint) throws TmfTraceImportException {
Comparator<Pair<Integer, TraceTypeHelper>> comparator = (o1, o2) -> {
- int res = -o1.getFirst().compareTo(o2.getFirst()); // invert so that highest confidence is first
+ int res = o2.getFirst().compareTo(o1.getFirst()); // invert so that highest confidence is first
if (res == 0) {
res = o1.getSecond().getName().compareTo(o2.getSecond().getName());
}

Back to the top