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>
* 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;
}
/**