dropwizard/dropwizard — pull request #682 by jchilders (2014-08-12 20:26:40+00:00)
Title: Simplify HibernateBundle constructor

One of the constructors for HibernateBundle is somewhat clumsy. This is an attempt to simplify it. The current signature for it is:

protected HibernateBundle(Class entity, Class... entities)

A concrete call to this would look something like:

new HibernateBundle(Person.class, Email.class, Attachment.class)...

A (debatably) cleaner way to to this would be to simply remove the first parameter of the existing constructor, simplifying it to:

protected HibernateBundle(Class... entities)

The concrete call to it could then look like:

Class[] entities = new Class[]{Person.class, Email.class, Attachment.class};
new HibernateBundle(entities);

This constructor was last modified in 2012, and originally had the signature that is being proposed as part of this pull request. The comment from them mentions Hibernate requiring at least one entity, so to add this protection some code was put into place which checks for this.