JDK 5/6 compatibility (untested).