backported to java 6