fix compilation error on jdk8: ensure the compiler doesn't complain

As promised. here's the PR for compiling under java 8.