You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The iteration order of the Map<K, V> that Guava's LoadingCache.getAll( Iterable<? extends K> keys ) returns is the same as the iteration order of the input keys, due to Guava using a LinkedHashMap under the hood. Caffeine, instead, uses a HashMap, and therefore the iteration is highly unlikely to be the same. I noticed this while migrating from Guava to Caffeine caches, as we have unfortunately relied on the iteration order being consistent. The getAll javadoc doesn't mention anything about the iteration order, and that should probably have told me to consider it as unspecified iteration order.
I'm creating this issue mainly as a way of documenting the difference in behaviour for others who migrate from Guava to Caffeine. Maybe an entry about this on the Guava wiki page would be suitable? Because I suppose you don't want to replace the internal HashMap with a LinkedHashMap.