ctf: Replace Long.compare() with Java 6 compatible method
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 25 Nov 2013 18:08:32 +0000 (13:08 -0500)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 25 Nov 2013 21:18:41 +0000 (16:18 -0500)
We still technically support Java 6, and Long.compare() was added in 7.

Change-Id: I565b40bbc11c1c1c3b05a4097cc0e619598d0553
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/18841
Reviewed-by: Etienne Bergeron <etienne.bergeron@gmail.com>
Tested-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
IP-Clean: Bernd Hufmann <bernd.hufmann@ericsson.com>

org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/Utils.java

index 69b9cfc2918ec28624ed72912c139e6f96d7d160..85689b56c4cb616a8dcc5486d29758f7986512c6 100644 (file)
@@ -80,7 +80,14 @@ public class Utils {
          * This idea is to rotate the domain by the length of the negative
          * space, and then use the signed operator.
          */
-        return Long.compare(left + Long.MIN_VALUE, right + Long.MIN_VALUE);
+        final long a = left + Long.MIN_VALUE;
+        final long b = right + Long.MIN_VALUE;
+        if (a < b) {
+            return -1;
+        } else if (a > b) {
+            return 1;
+        }
+        return 0;
     }
 
     /**
This page took 0.027105 seconds and 5 git commands to generate.