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



##########
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:
       The main problem is not Math.abs, is INT_MIN. As the absolute value of 
INT_MIN is greater than INT_MAX, there is no positive int value can represent 
the absolute value of INT_MIN... You could try the piece of code here, let 
priority to be INT_MIN, you will still get a INT_MIN with -priority...




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to