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 4ee02044 Use final
4ee02044 is described below

commit 4ee02044e5ac5b9dc73c2c6d1b2d36524b0d552a
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Thu Jun 12 12:13:54 2025 -0400

    Use final
---
 .../java/org/apache/commons/exec/ShutdownHookProcessDestroyer.java  | 6 +++---
 src/main/java/org/apache/commons/exec/launcher/CommandLauncher.java | 2 +-
 src/test/java/org/apache/commons/exec/LogOutputStreamTest.java      | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/exec/ShutdownHookProcessDestroyer.java 
b/src/main/java/org/apache/commons/exec/ShutdownHookProcessDestroyer.java
index 2f4c7d07..8e3a16a8 100644
--- a/src/main/java/org/apache/commons/exec/ShutdownHookProcessDestroyer.java
+++ b/src/main/java/org/apache/commons/exec/ShutdownHookProcessDestroyer.java
@@ -33,7 +33,7 @@ public class ShutdownHookProcessDestroyer implements 
ProcessDestroyer, Runnable
         /**
          * Whether to run the ShutdownHookProcessDestroyer.
          */
-        private AtomicBoolean shouldDestroy = new AtomicBoolean(true);
+        private final AtomicBoolean shouldDestroy = new AtomicBoolean(true);
 
         private ProcessDestroyerThread() {
             super("ProcessDestroyer Shutdown Hook");
@@ -58,12 +58,12 @@ public class ShutdownHookProcessDestroyer implements 
ProcessDestroyer, Runnable
     private ProcessDestroyerThread destroyProcessThread;
 
     /** Whether or not this ProcessDestroyer has been registered as a shutdown 
hook. */
-    private AtomicBoolean added = new AtomicBoolean();
+    private final AtomicBoolean added = new AtomicBoolean();
 
     /**
      * Whether or not this ProcessDestroyer is currently running as shutdown 
hook.
      */
-    private AtomicBoolean running = new AtomicBoolean();
+    private final AtomicBoolean running = new AtomicBoolean();
 
     /**
      * Constructs a {@code ProcessDestroyer} and obtains {@code 
Runtime.addShutdownHook()} and {@code Runtime.removeShutdownHook()} through 
reflection. The
diff --git 
a/src/main/java/org/apache/commons/exec/launcher/CommandLauncher.java 
b/src/main/java/org/apache/commons/exec/launcher/CommandLauncher.java
index 3703bd30..2a5ce867 100644
--- a/src/main/java/org/apache/commons/exec/launcher/CommandLauncher.java
+++ b/src/main/java/org/apache/commons/exec/launcher/CommandLauncher.java
@@ -62,7 +62,7 @@ public interface CommandLauncher {
      * @throws IOException if trying to change directory.
      * @since 1.5.0
      */
-    default Process exec(CommandLine commandLine, Map<String, String> env, 
Path workingDirectory) throws IOException {
+    default Process exec(final CommandLine commandLine, final Map<String, 
String> env, final Path workingDirectory) throws IOException {
         return exec(commandLine, env, workingDirectory != null ? 
workingDirectory.toFile() : null);
     }
 
diff --git a/src/test/java/org/apache/commons/exec/LogOutputStreamTest.java 
b/src/test/java/org/apache/commons/exec/LogOutputStreamTest.java
index a158013d..53d409a4 100644
--- a/src/test/java/org/apache/commons/exec/LogOutputStreamTest.java
+++ b/src/test/java/org/apache/commons/exec/LogOutputStreamTest.java
@@ -42,7 +42,7 @@ class LogOutputStreamTest {
 
     private static final class SystemLogOutputStream extends LogOutputStream {
 
-        private StringBuffer output = new StringBuffer();
+        private final StringBuffer output = new StringBuffer();
 
         private SystemLogOutputStream(final int level) {
             super(level);

Reply via email to