We have a requirement to shuffle an ArrayList using a seed
The code is something like:
List<String> tempList = new ArrayList<>()
//code to populdate the tempList
Random rng = new Random(2018);
Collections.shuffle(tempList, rng);
P.S. The reason we provided a static Random seed is to make sure it always produce the same result after the shuffling.
What we have observed is that the shuffled result is different on dev machines(Mac) from the one on our build machines(Linux)
I am wondering if this method itself is platform dependent?
Aucun commentaire:
Enregistrer un commentaire