Breaking Up is Hard to do... or is it?: From Java 6 to 7

by Rodrigo Reis - 11 Apr 2013

With the advent of Java 7, it’s time to move on and say goodbye to
Java 6. For an extensive codebase like ours with about 400 modules, that’s a
real challenge. But, as Barney Stinson famously said, "Challenge Accepted!"
Because we’ve already had a few new projects compiling with Java 7 and using
the new language features, we were very motivated to migrate all of our
remaining projects.

With the help of some automation - e.g. Python to the rescue! - and since we
use Maven to manage our projects, it was a matter of some lines of code to
develop a script that tests compilation (and running unit tests, of course) on
Java 7.

After our first pass, great news: almost all of our
code is ready for Java 7! Code that failed just needed a few minor changes.
These minor changes were necessary because of a few incompatible JDK API
changes such as introducing a new method in javax.sql.CommonDataSource.

Overall, we managed to develop a tool that automates migration to not only
Java 7, but also to the upcoming versions. In the end, this walk is not particularly silly!