Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-36

[lang] patch and test case fixing problem with RandomStringUtils.random()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0
    • None
    • None
    • Operating System: other
      Platform: Other

    • 19880

    Description

      When a set of characters is supplied to RandomStringUtils.random(), the last
      character in the set never appears in generated strings.

      Attaching patch and test case showing failure.

      The test case generates 100 6-character strings from a 3-character set and
      compares the observed frequency of occurrence of each of the characters in the
      set with expectation assuming purely random selection. Uses a chi-square test.

      Attachments

        Activity

          People

            Unassigned Unassigned
            phil@steitz.com Phil Steitz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: