0

Working on some code, we discovered some tests that previously passed but failed when we ran them under Java 8. This was due to dodgy test code that relied on the ordering that the keys were returned from a HashMap.

We understand that the order is not guaranteed unless we use a SortedMap. We're just curious - what is the change that has affected the ordering?

nevster
  • 6,271
  • 7
  • 35
  • 42
  • 5
    the order is **undefined** and **implementation specific** always has been, so the reason is probably they changed the implementation. Look at the source if you really want to know exactly why. –  May 13 '15 at 01:36
  • 2
    http://java.dzone.com/articles/hashmap-performance – Thilo May 13 '15 at 01:47

0 Answers0