-
Enhancement
-
Resolution: Done
-
Minor
-
14.0.1.Final
-
None
-
Undefined
-
https://github.com/wildfly/wildfly-core/pull/4550, https://github.com/wildfly/wildfly-core/pull/4551, https://github.com/wildfly/wildfly-core/pull/4552, https://github.com/wildfly/wildfly-core/pull/4553, https://github.com/wildfly/wildfly-core/pull/4554, https://github.com/wildfly/wildfly-core/pull/4555, https://github.com/wildfly/wildfly-core/pull/4556, https://github.com/wildfly/wildfly-core/pull/4557, https://github.com/wildfly/wildfly-core/pull/4558, https://github.com/wildfly/wildfly-core/pull/4560, https://github.com/wildfly/wildfly-core/pull/4563, https://github.com/wildfly/wildfly-core/pull/4564, https://github.com/wildfly/wildfly-core/pull/4565, https://github.com/wildfly/wildfly-core/pull/4567
Currently there are different approaches to have null checks of parameters and throw a NullPointerException or IllegalArgumentException. Most 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 the common solution.
There is an existing solution for these cases:
org.wildfly.common.Assert.checkNotNullParamWithNullPointerException;
org.wildfly.common.Assert.checkNotNullParam;
The approach 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.
Some modules require org.wildfly.common as new dependency.
To ease the pull request verification process, several pull requests (by sub-project) are provided.