Harmony
  1. Harmony
  2. HARMONY-6323

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

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0M12
    • Component/s: Classlib
    • Labels:
      None
    • Environment:
      SVN Revision 801399
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      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.

        Activity

          People

          • Assignee:
            Tim Ellison
            Reporter:
            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

                Development