Port to Java 5 (inspired by Ant 1.9)