jcwinters commented on code in PR #1379:
URL: https://github.com/apache/commons-lang/pull/1379#discussion_r2086153654


##########
src/main/java/org/apache/commons/lang3/RandomStringUtils.java:
##########
@@ -97,6 +97,7 @@ public class RandomStringUtils {
     private static final int ASCII_9 = '9';
     private static final int ASCII_A = 'A';
     private static final int ASCII_z = 'z';
+    private static final int MAX_CACHE_SIZE = 60_000_000;

Review Comment:
   Yes but that ignores rejections, `next()` is called every time we evaluate a 
candidate bit pattern, some of them are rejected.  In my testing (10000 runs) 
that rejection happens between 62 and 62.4M times.  To be honest there is 
probably a very small chance of overflow even at 60M if the rejection rate is 
statistically high.



-- 
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: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to