apurtell commented on a change in pull request #3936:
URL: https://github.com/apache/hbase/pull/3936#discussion_r768070886
##########
File path:
hbase-client/src/main/java/org/apache/hadoop/hbase/client/PerClientRandomNonceGenerator.java
##########
@@ -32,13 +32,14 @@
public final class PerClientRandomNonceGenerator implements NonceGenerator {
private static final PerClientRandomNonceGenerator INST = new
PerClientRandomNonceGenerator();
-
- private final Random rdm = new Random();
private final long clientId;
+ private Random rng;
Review comment:
Spotbugs wants you to allocate a Random object and reuse it as often as
possible. This is because if you do not reuse Random, if you just do like so in
a method
Random r = new Random();
// do something with 'r'
the quality of the generated random numbers is poor.
--
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]