Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.7
-
Fix Version/s: JRuby 1.7.0.pre2
-
Component/s: Java Integration
-
Labels:None
-
Environment:jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_31) [linux-amd64-java]
-
Number of attachments :
Description
If I try java.util.Collections.shuffle on a ruby array, I get a strange result.
I attached an example code for it
Actual result:
Ruby array
Original: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Shuffled: [0, 3, 6, 7, 7, 7, 7, 9, 9, 10, 10]
Java array
Original: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Shuffled: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Confirmed, but I have no theory yet.