Build on 7

@Sanne Here is the change which does the required changes for building with Java 7, maintaining compatibility to Java 6. Feel free to pick these commits into your branch and close this PR thereafter, however it works best for you.

https://github.com/gunnarmorling/hibernate-search/commit/09c328a22d6fac99485fb8741c233796635a3c90 is not strictly related but I added it in this context as it gets rid of one more build warning.