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-exec.git


The following commit(s) were added to refs/heads/master by this push:
     new 155ef4e  Use Objects.requireNonNull()
155ef4e is described below

commit 155ef4e5341628c4d37595aaf67aff6bccb7e590
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Fri May 6 08:04:53 2022 -0400

    Use Objects.requireNonNull()
---
 src/main/java/org/apache/commons/exec/ExecuteWatchdog.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java 
b/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java
index 2cfb561..754d3b7 100644
--- a/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java
+++ b/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java
@@ -18,6 +18,8 @@
 
 package org.apache.commons.exec;
 
+import java.util.Objects;
+
 import org.apache.commons.exec.util.DebugUtils;
 
 /**
@@ -104,9 +106,7 @@ public class ExecuteWatchdog implements TimeoutObserver {
      *             if a process is still being monitored.
      */
     public synchronized void start(final Process processToMonitor) {
-        if (processToMonitor == null) {
-            throw new NullPointerException("process is null.");
-        }
+        Objects.requireNonNull(processToMonitor, "processToMonitor");
         if (this.process != null) {
             throw new IllegalStateException("Already running.");
         }

Reply via email to