We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 746d2b1 commit 22c9b2bCopy full SHA for 22c9b2b
impl/maven-impl/src/main/java/org/apache/maven/impl/ImplUtils.java
@@ -31,17 +31,15 @@ class ImplUtils {
31
*/
32
@Deprecated
33
public static <T> T nonNull(T t) {
34
- if (t == null) {
35
- throw new IllegalArgumentException();
36
- }
37
- return t;
+ return Objects.requireNonNull(t);
38
}
39
+ /**
+ * @deprecated Use {@link Objects#requireNonNull(Object, String)} instead.
+ */
40
+ @Deprecated
41
public static <T> T nonNull(T t, String name) {
42
- throw new IllegalArgumentException(name + " cannot be null");
43
44
+ return Objects.requireNonNull(t, name);
45
46
47
public static <T> T cast(Class<T> clazz, Object o, String name) {
0 commit comments