At the company I work for we are currently migrating all of our applications from a Java 6 to a Java 7 environment. All went well, until some of our integration tests started failing: The program output no longer matched the predicted program output.
Specifically, the order of the output lines had changed for a large number of applications.
Going through some code (this took well over a week) we found out we were iterating over a number of non-ordered collections. Apparently, the implementation of this - and thus the output order - has changed between the Java versions.
Our problem is now that we probably do this in MANY places, and catching them all by hand would be near impossible. So I am here to ask whether there exists somesort of blanket solution OR a systematic way to find all occurences of this mistake.
Java 7u6 introduced a new hashing function for strings, see Java 7 Collection Updates. This should be disabled by default, but it may be enabled in your environment and explain the differences in iteration order.