For Sun/Oracle JDKs, and IBM JDK 1.6, we have this:
For IBM JDKs 1.7 and 1.8, it changed to this (I do not know why):
This causes a few example-based tests in Clojure to fail when run on those IBM JDK versions. There does not appear to be any bug in Clojure here. Those tests were written with particular constant values that are different, but have equal .hashCode values, to test Clojure's code generated that selects between branches in a case. In particular, these tests in control.clj fail:
There are other tests in the same file with the same constant 9223372039002259457N that do not fail with IBM JDKs 1.7 and 1.8, but they do not test hash collisions as they were intended to.
Some possibilities for what could be changed:
1. Pick a different pair of number other than 1 and 9223372039002259457N when running tests on IBM JDKs 1.7 and 1.8, so that the hash values do collide. For example, 33 and 9223372039002259457N.
2. skip these tests completely when running on IBM JDKs 1.7 and 1.8.
IBM JDK 1.7 and 1.8