Fix compilation with java 6 (JAVA-7147 regression)