You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/05/22 04:09:15 UTC

[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #4350: [ISSUE #4349]: Fix the potential 'IndexOutOfBoundsException' etc

Oliverwqcwrw commented on code in PR #4350:
URL: https://github.com/apache/rocketmq/pull/4350#discussion_r878790154


##########
client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java:
##########
@@ -76,7 +76,9 @@ public String pickOneAtLeast() {
             if (half <= 0) {
                 return tmpList.get(0).getName();
             } else {
-                final int i = this.whichItemWorst.incrementAndGet() % half;
+                int i = this.whichItemWorst.incrementAndGet() % half;
+                if (i < 0)

Review Comment:
   IMO,  `i` can not less than zero



-- 
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: dev-unsubscribe@rocketmq.apache.org

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