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

Random:from() adapter does not delegate to supplied generator in all cases

XMLWordPrintable

    • b21
    • b29
    • Verified

        As per the spec : https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/util/Random.html#from(java.util.random.RandomGenerator)

        " If the generator is an instance of Random, it is returned. Otherwise, this method returns an instance of Random that delegates all methods except setSeed to the generator."

        Expectation :
        Any method of RandomGenerator invocation on the returned instance of adpater method shall delegate to the supplied RandomGenerator except for setSeed.

        Actual :
        Not all methods of RandomGenerator are delegated

        Attached a sample to demonstrate the issue.

              rgiulietti Raffaello Giulietti
              kganapureddy Krushnareddy Ganapureddy
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: