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
commit a41ace531bcb318f410d19e302b5b2c99ff7ad97 Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Sat May 24 09:37:29 2025 -0400 Sort members --- .../org/apache/commons/exec/DefaultExecutor.java | 24 +++++++++++----------- .../org/apache/commons/exec/ExecuteWatchdog.java | 20 +++++++++--------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main/java/org/apache/commons/exec/DefaultExecutor.java b/src/main/java/org/apache/commons/exec/DefaultExecutor.java index 50940dd5..f9f01e72 100644 --- a/src/main/java/org/apache/commons/exec/DefaultExecutor.java +++ b/src/main/java/org/apache/commons/exec/DefaultExecutor.java @@ -62,8 +62,8 @@ public class DefaultExecutor implements Executor { */ public static class Builder<T extends Builder<T>> implements Supplier<DefaultExecutor> { - private ThreadFactory threadFactory; private ExecuteStreamHandler executeStreamHandler; + private ThreadFactory threadFactory; private Path workingDirectory; /** @@ -168,14 +168,14 @@ public class DefaultExecutor implements Executor { return new Builder<>(); } + /** The first exception being caught to be thrown to the caller. */ + private IOException exceptionCaught; + /** Taking care of output and error stream. */ private ExecuteStreamHandler executeStreamHandler; - /** The working directory of the process. */ - private Path workingDirectory; - - /** Monitoring of long running processes. */ - private ExecuteWatchdog watchdog; + /** Worker thread for asynchronous execution. */ + private Thread executorThread; /** The exit values considered to be successful. */ private int[] exitValues; @@ -186,17 +186,17 @@ public class DefaultExecutor implements Executor { /** Optional cleanup of started processes. */ private ProcessDestroyer processDestroyer; - /** Worker thread for asynchronous execution. */ - private Thread executorThread; - - /** The first exception being caught to be thrown to the caller. */ - private IOException exceptionCaught; - /** * The thread factory. */ private final ThreadFactory threadFactory; + /** Monitoring of long running processes. */ + private ExecuteWatchdog watchdog; + + /** The working directory of the process. */ + private Path workingDirectory; + /** * Constructs a default {@code PumpStreamHandler} and sets the working directory of the subprocess to the current working directory. * diff --git a/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java b/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java index 92570c11..4130ea5f 100644 --- a/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java +++ b/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java @@ -120,23 +120,17 @@ public class ExecuteWatchdog implements TimeoutObserver { return new Builder(); } - /** The process to execute and watch for duration. */ - private Process process; + /** Exception that might be thrown during the process execution. */ + private Exception caught; /** Is a user-supplied timeout in use. */ private final boolean hasWatchdog; - /** Say whether or not the watchdog is currently monitoring a process. */ - private boolean watch; - - /** Exception that might be thrown during the process execution. */ - private Exception caught; - /** Say whether or not the process was killed due to running overtime. */ private boolean killedProcess; - /** Will tell us whether timeout has occurred. */ - private final Watchdog watchdog; + /** The process to execute and watch for duration. */ + private Process process; /** Indicates that the process is verified as started */ private volatile boolean processStarted; @@ -146,6 +140,12 @@ public class ExecuteWatchdog implements TimeoutObserver { */ private final ThreadFactory threadFactory; + /** Say whether or not the watchdog is currently monitoring a process. */ + private boolean watch; + + /** Will tell us whether timeout has occurred. */ + private final Watchdog watchdog; + /** * Creates a new watchdog with a given timeout. *