mikemccand commented on code in PR #12772: URL: https://github.com/apache/lucene/pull/12772#discussion_r1383419161
########## gradle/validation/forbidden-apis/defaults.tests.txt: ########## @@ -21,3 +21,7 @@ java.lang.System#currentTimeMillis() @ Don't depend on wall clock times #java.lang.System#nanoTime() @ Don't depend on wall clock times java.text.Collator#compare(**) @ Use LuceneTestCase.collate instead, which can avoid JDK-8071862 + +# #12771: dangerously slow implementation when the range is small +java.util.Random#nextInt(int,int) +java.util.Random#nextLong(long,long) Review Comment: Phew, OK, so it should be fast enough since it pre-scopes the range of randomness to "next power of two" containing your requested range. So net/net I don't think we need to ban these APIs. I'll cancel the PR. Thanks @rmuir! -- 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...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org