apurtell opened a new pull request #4118:
URL: https://github.com/apache/hbase/pull/4118


   [_This change does not cause any test failures (when tested locally) but 
there are flaky tests failing on master branch, so expect precommit results to 
be unclean_.] 
   
   Avoid the pattern where a Random object is allocated, used once or twice, 
and then left for GC. This pattern triggers warnings from some static analysis 
tools because this pattern leads to poor effective randomness. In a few cases 
we were legitimately suffering from this issue; in others a change is still 
good to reduce noise in analysis results.
   
   Use ThreadLocalRandom where there is no requirement to set the seed to gain 
good reuse.
   
   Where useful relax use of SecureRandom to simply Random or 
ThreadLocalRandom, which are unlikely to block if the system entropy pool is 
low, if we don't need crypographically strong randomness for the use case. The 
exception to this is
   normalization of use of Bytes#random to fill byte arrays with randomness. 
Because Bytes#random may be used to generate key material it must be backed by 
SecureRandom.


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