This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jcs.git
The following commit(s) were added to refs/heads/master by this push: new 3ddc232c Use Objects.requireNonNull() 3ddc232c is described below commit 3ddc232c94db22cb1e616601c27d0153d4a0de2b Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Thu Dec 26 14:13:47 2024 -0500 Use Objects.requireNonNull() --- .../src/main/java/org/apache/commons/jcs3/jcache/Asserts.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/commons-jcs3-jcache/src/main/java/org/apache/commons/jcs3/jcache/Asserts.java b/commons-jcs3-jcache/src/main/java/org/apache/commons/jcs3/jcache/Asserts.java index 93c7fbd8..1ef22730 100644 --- a/commons-jcs3-jcache/src/main/java/org/apache/commons/jcs3/jcache/Asserts.java +++ b/commons-jcs3-jcache/src/main/java/org/apache/commons/jcs3/jcache/Asserts.java @@ -1,5 +1,7 @@ package org.apache.commons.jcs3.jcache; +import java.util.Objects; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -23,10 +25,7 @@ public class Asserts { public static void assertNotNull(final Object value, final String name) { - if (value == null) - { - throw new NullPointerException(name + " is null"); - } + Objects.requireNonNull(name, () -> name + " is null"); } private Asserts()