Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6323

[classlib] [luni] Simplify and speed-up collection shuffle, add a non-probabilistic test

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 5.0M12
    • Classlib
    • None
    • SVN Revision 801399
    • Patch Available
    • Moderate

    Description

      Shuffle needlessly tests Random.nextInt() for a negative value
      It iterates from index N-1 to 0, which means it always swaps index 0 with itself needlessly.
      It is only tested with probabilistic tests, the patch adds a proper test. Note that the attached test also passes on the RI.

      Attachments

        1. Shuffle-fixes.patch
          4 kB
          Jesse Wilson

        Activity

          People

            tellison Tim Ellison
            jessewilson Jesse Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.25h
                0.25h
                Remaining:
                Remaining Estimate - 0.25h
                0.25h
                Logged:
                Time Spent - Not Specified
                Not Specified