Backport source code to Java 1.7