LGTM has raised some alerts during analysis of Hibernate ORM (https://lgtm.com/projects/g/hibernate/hibernate-orm/alerts/?mode=tree). This issue is to fix some of those alerts.