panzhi33 commented on PR #4350:
URL: https://github.com/apache/rocketmq/pull/4350#issuecomment-1136578850

   > @ni-ze , @HScarb ,
   > 
   > Thanks for your review. But IMO, For code consistency, I recommend not 
changing this method `ThreadLocalIndex#incrementAndGet()`, because this method 
is used in many places. In most scenarios, it judge whether the result returned 
is positive or negative after the call, as shown below:
   > 
   > 
![image](https://user-images.githubusercontent.com/8653312/169936803-9ed90df7-35ff-4b8e-8c3c-225c0cee838f.png)
   > 
   > And if we changing this method(`ThreadLocalIndex#incrementAndGet()`), The 
variable `index` it returned may be a positive number(eg: `Integer.MAX_VALUE`). 
when `Math.abs(++index)` is called, we still need to judge if this value is 
negative, just looks like in the screenshot.
   > 
   > Hi @panzhi33 , @RongtongJin what's your opinion?
   
   I think it is better to modify 
org.apache.rocketmq.client.common.ThreadLocalIndex#incrementAndGet.


-- 
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