Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8274685

Documentation suggests there are ArbitrarilyJumpableGenerator when none

XMLWordPrintable

    • b25
    • generic
    • generic
    • Verified

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10 21H1 64 bit JDK 17

      A DESCRIPTION OF THE PROBLEM :
      Running this code:
          System.out.println("isArbitrarilyJumpable() factories:");
          RandomGeneratorFactory.all().filter(x->x.isArbitrarilyJumpable())
          .forEach(x->System.out.println(x.name()));
      produces no generators that are arbitrarily jumpable when the documentation
      https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/package-summary.html includes this text:
      There is also an interface RandomGenerator.ArbitrarilyJumpableGenerator for algorithms that allow jumping along the state cycle by any user-specified distance. In this package, implementations of these interfaces include "Xoroshiro128PlusPlus", and "Xoshiro256PlusPlus".


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the code:
       System.out.println("isArbitrarilyJumpable() factories:");
       RandomGeneratorFactory.all().filter(x->x.isArbitrarilyJumpable())
          .forEach(x->System.out.println(x.name()));

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expect there to be two factories as documented.
      ACTUAL -
      No factories are output, implying none are capable of arbitrary jumps.

      ---------- BEGIN SOURCE ----------
        public void test()
        {
          assertNotEquals(0, RandomGeneratorFactory.all().filter(x->x.isArbitrarilyJumpable()).count());
        }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None.

      FREQUENCY : always


            gls Guy Steele (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: