Uploaded image for project: 'Commons Text'
  1. Commons Text
  2. TEXT-36

RandomStringGenerator: allow users to provide source of randomness

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1
    • Labels:

      Description

      This is a follow-up of a discussion held in TEXT-34.

      IMHO, there is no harm in depending on the "commons-rng-client-api" module of Commons RNG; the "zero dependency" mantra does not hold here, since TEXT already depends on LANG.

      OTOH, I see that it is counter-productive (i.e. it harms the Commons project as a whole) to not advertize or use other Commons components, despite the "own dog food" phrase appearing recurrently on the "dev" ML.

      Rather than having people blindly use java.util.Random, we should allow them to choose wisely, based on full information.
      IMO, that means to indeed use UniformRandomProvider in order to raise awareness about alternatives to the sub-optimal algorithm used by the JDK.

      However, if some Commons developers do not trust that the UniformRandomProvider interface can be stable enough for TEXT, then we should follow Jochen Wiedemann's advice (cf. archive of the "dev" ML) and define TEXT's own interface to random numbers, with bridges to it from UniformRandomProvider and from java.util.Random.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pascalschumacher Pascal Schumacher
                Reporter:
                erans Gilles
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: