apurtell commented on a change in pull request #3936: URL: https://github.com/apache/hbase/pull/3936#discussion_r768070642
########## File path: hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestCoprocessorDescriptor.java ########## @@ -71,7 +67,11 @@ public void testSetCoprocessor() throws IOException { List<CoprocessorDescriptor> cps = new ArrayList<>(); for (String className : Arrays.asList("className0", "className1", "className2")) { String path = "path"; - int priority = Math.abs(className.hashCode()); + // Ensure priority is a positive integer + int priority = className.hashCode(); + if (priority < 0) { + priority = -priority; 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