Skip to content

Commit

Permalink
Use Objects.requireNonNull()
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed May 6, 2022
1 parent c03d92f commit 155ef4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/apache/commons/exec/ExecuteWatchdog.java
Expand Up @@ -18,6 +18,8 @@

package org.apache.commons.exec;

import java.util.Objects;

import org.apache.commons.exec.util.DebugUtils;

/**
Expand Down Expand Up @@ -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.");
}
Expand Down

0 comments on commit 155ef4e

Please sign in to comment.