4 ms·
You have the same kind of idea in the JDK to be sure that a user code does not work if it relies on the iteration order of an immutable Set, the JDK use a SALT
by _old_dude_ 8y ago
You have the same kind of idea in the JDK to be sure that a user code does not work if it relies on the iteration order of an immutable Set, the JDK use a SALT [1] so the iteration order of the Set is different each time you start a new VM allowing the code of the JDK to be changed in the future.
[1] http://hg.openjdk.java.net/jdk/jdk/file/f36d08a3e700/src/java.base/share/classes/java/util/ImmutableCollections.java#l56 http://hg.openjdk.java.net/jdk/jdk/file/f36d08a3e700/src/jav...