apurtell commented on a change in pull request #3936:
URL: https://github.com/apache/hbase/pull/3936#discussion_r768070397
##########
File path:
hbase-common/src/test/java/org/apache/hadoop/hbase/io/util/TestLRUDictionary.java
##########
@@ -81,9 +83,8 @@ public void testPassingSameArrayToAddEntry() {
@Test
public void testBasic() {
- Random rand = new Random();
byte[] testBytes = new byte[10];
- rand.nextBytes(testBytes);
+ RNG.nextBytes(testBytes);
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]