More JavaCC and Java 1.5

28 Aug 2007

Last week I posted about some improvements to JavaCC's Java 1.5 code output. We've had some discussion on javacc-dev since then and now Sreenivasa has made the call - we're moving to Java 1.5 for JavaCC internally!

This means, of course, that you'll need a Java 1.5 runtime in order to run future releases of JavaCC. But if your project is still using a Java 1.4 VM, no worries, JavaCC will continue to generate Java 1.4-compliant code for the foreseeable future. As mentioned in my last post, just use the option setting JDK_VERSION="1.4".

I'm getting ready to check in a patch that migrates one of JavaCC's internal classes to Java 1.5. Look at all the code that goes away - autoboxing sure makes a nice difference. And using generics in the collections declarations makes the code more self-documenting, too. I know this is old hat for folks who having been using this stuff for a while, but I'm still pretty jazzed about it. Good times.

For more on JavaCC, get my JavaCC book!