port to java 7