Is it time for Java 5?

A major goal of the Stringtree software project has always been to be as compatible as possible with all the software people are using for their Java development. Naturally that also includes whatever Java version is being used.

For a long time I interpreted this goal as implying that all Stringtree code should run on all Java versions from Java 1.2 onwards. Java 1.4, however, introduced some compelling new features including built-in regular-expression handling. For a few years I still tried to ensure that most code was still 1.2-compatible (for example by using Ant to swap in a third-party regular-expression library while building a jar file), while also providing a Java 1.4 version. Eventually, use of Java versions prior to 1.4 declined enough that I felt comfortable removing the complicated pre-1.4 version.

For the last few years I have been very careful to keep all my Stringtree code compatible with all versions of Java from 1.4 upwards. Now, however, the pressure is building again to move over to Java 5. In my day-to-day coding I develop with Java 5 and make increasing use of Java 5 features such as the enhanced for loop, the Iterable interface, enums, generics, autoboxing, varargs and so on. It would be very nice to be able to update the Stringtree codebase to use these features too.

Occasionally a Java 5-specific detail has crept in to a Stringtree library, and I have soon received comments or emails pointing this out. I haven’t noticed this for a while, which might indicate either that I have been especially careful, or that I there are no longer any/many people developing with Stringtree code who are still limited to Java 1.4.

If you are reading this and you still require Java 1.4 support, please let me know. Likewise, if you have thrown off the shackles of 1.4 within the last year or so or are desperately hoping for a Java 5 Stringtree that would be good to know too.

Is it time for Java 5 yet?

3 Comments

  1. Ditch 1.4. While you’re at have you considered going straight to java 6? Can I currently use stringtree with java 6 if I’m using jdbc? Seem to recall some problem with the java DriverManager interface changing between 5 and 6. Maybe 2 different jars are needed – 1 for each of java 5 and 6?

  2. The issue I think you are referring to is the way that Sun have broken some key interfaces within JDBC by adding new methods from other interfaces.

    This is extremely irritating, and an example of the thoughtlessness which has accompanied several Java versions. The whole point of an interface is that it should allow multiple implementations from multiple creators; changing an interface in a way which breaks existing implementations is plain stupid.

    I plan to work through the Stringtree code and implement as many of these new methods as I can while maintaining backward compatibility, even if I don’t move the whole codebase to a new Java version.

  3. Pingback: blog.stringtree.org » Blog Archive » Java 6 breaks JDBC

Comments are closed.