diff --git a/zipkin-storage/zipkin2_cassandra/src/main/java/zipkin2/storage/cassandra/CassandraUtil.java b/zipkin-storage/zipkin2_cassandra/src/main/java/zipkin2/storage/cassandra/CassandraUtil.java index 2a8cbdcc003..60dc501f283 100644 --- a/zipkin-storage/zipkin2_cassandra/src/main/java/zipkin2/storage/cassandra/CassandraUtil.java +++ b/zipkin-storage/zipkin2_cassandra/src/main/java/zipkin2/storage/cassandra/CassandraUtil.java @@ -106,7 +106,7 @@ enum TraceIdsSortedByDescTimestamp implements Call.Mapper, Set for (Map.Entry entry : map.entrySet()) { BigInteger uncollided = BigInteger.valueOf(entry.getValue()) .multiply(OFFSET) - .add(BigInteger.valueOf(RAND.nextInt())); + .add(BigInteger.valueOf(RAND.nextInt() & Integer.MAX_VALUE)); sorted.put(uncollided, entry.getKey()); } return new LinkedHashSet<>(sorted.values());