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

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

    XMLWordPrintable

Details

    • b21
    • b29
    • Verified

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: