Alonexc opened a new issue, #3466:
URL: https://github.com/apache/incubator-eventmesh/issues/3466

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Enhancement Request
   
   
![image](https://user-images.githubusercontent.com/91315508/225789463-72d51125-c71b-45da-9aea-2e91d2c7522d.png)
   located at:
   
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/common/TcpClient.java
 line 63
   analysis and explanation:
   Creating a new Random object each time a random value is needed is 
inefficient and may produce numbers which are not random depending on the JDK. 
For better efficiency and randomness, create a single Random, then store, and 
reuse it.
   The Random() constructor tries to set the seed with a distinct value every 
time. However there is no guarantee that the seed will be random or even 
uniformly distributed. Some JDK will use the current time as seed, which makes 
the generated numbers not random at all.
   This rule finds cases where a new Random is created each time a method is 
invoked.
   
   
   ### Describe the solution you'd like
   
   
![image](https://user-images.githubusercontent.com/91315508/225789505-c6f2ffbc-2f4b-43ca-98ce-16e76ca3f103.png)
   
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to