Utilize new Validator class for Null-Checks

Description

Currently there are different approaches to have null checks of parameters and throw a NullPointerException or IllegalArgumentException. Some of them do not offer the parameter name which is null or causing a null lookup. Some of them offer the parameter name but are not I18N. Some offer both, but don't reuse a common solution.
There are several existing solution for these cases:
org.wildfly.common.Assert
com.google.base.Preconditions
org.apache.commons.lang3.Validate
Aside from license issues all would cause a new dependency and would not utilize the Hibernate I18N messaging including an id.

First step is to adopt the neccessary class org.hibernate.internal.util.Validator and org.hibernate.internal.log.ValidatorLogger. It's not a plain copy to avoid any copyright issues.

The approach of the refactoring is to have the same method signature, keep NullPointerException and/or IllegalArgumentException in the same way as now. Only the check and throw is changed with the mentioned methods.

There 60 classes affected.

Environment

None

Assignee

Unassigned

Reporter

Boris Unckel

Labels

Suitable for new contributors

Yes, likely