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

        Jesse Wilson created issue -
        Jesse Wilson made changes -
        Field Original Value New Value
        Attachment Shuffle-fixes.patch [ 12417942 ]
        Jesse Wilson made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Tim Ellison made changes -
        Assignee Tim Ellison [ tellison ]
        Tim Ellison made changes -
        Summary Simplify and speed-up shuffle, add a non-probabilistic test [classlib] [luni] Simplify and speed-up collection shuffle, add a non-probabilistic test
        Tim Ellison made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.0M12 [ 12314191 ]
        Resolution Fixed [ 1 ]
        Tim Ellison made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Tim Ellison made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Jesse Wilson made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          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