Fix compilation failure with Java 8 target