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

As promised. here's the PR for compiling under java 8. There's also a PR for `crate/elasticsearch` at https://github.com/crate/elasticsearch/pull/7