From 155ef4e5341628c4d37595aaf67aff6bccb7e590 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 6 May 2022 08:04:53 -0400 Subject: [PATCH] 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 2cfb5619c..754d3b7b1 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 ExecuteWatchdog(final long timeout) { * 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."); }