rmuir commented on code in PR #12772:
URL: https://github.com/apache/lucene/pull/12772#discussion_r1383388421


##########
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:
   i checked the code, there is indeed a loop, but the internal class doing 
this claims more, that the loop should only execute 1 or 2 times: 
https://github.com/openjdk/jdk/blob/1c2ea1d27b1895dca3b30073e3516978083dc70a/src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java#L414
   
   Not sure i believe it. If this is really the expected behavior wouldn't it 
claim it in the public javadoc rather than terrifying everyone :)



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

Reply via email to