apurtell commented on a change in pull request #3936:
URL: https://github.com/apache/hbase/pull/3936#discussion_r768068944



##########
File path: 
hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java
##########
@@ -373,7 +375,11 @@ public void close() throws IOException {
       taskId = taskId + iteration * numMapTasks;
       numMapTasks = numMapTasks * numIterations;
 
-      long chainId = Math.abs(new Random().nextLong());
+      // ensure chainId is positive
+      long chainId = RNG.nextLong();
+      if (chainId < 0) {

Review comment:
       As explained by the help text for the spotbugs finding the issue is 
Math.abs(INT_MIN) can return INT_MIN. So if ABS is supposed to ensure a 
positive number, it will not always do so. The fix is to change the sign of the 
value if it is negative and should not be negative. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to