RuntimeExceptions should be chained if caught
Brought to you by:
djmamana,
martingoros
see AbstractEntityRegistrationManager:
} catch (RuntimeException e) {
throw new EntitiesRegistrationException(e.getMessage());
should be:
} catch (RuntimeException e) {
throw new EntitiesRegistrationException(e.getMessage(), e);
But even better: don't catch it all! RuntimeExceptions should not be caught if you can't perfectly handle them. Just let them bubble up the stack.
That code is doing nothing more then obscuring the real exception.
This could be added though:
if (entity == null) {
throw new IllegalArgumentException("The entity (" + entity + ") must not be null.");
}