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 4e97667  Don't initialize an instance or static variable to its 
default value
4e97667 is described below

commit 4e976679250f57bce75e5596ae34cfdc0805df20
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Oct 27 09:51:52 2023 -0400

    Don't initialize an instance or static variable to its default value
---
 src/conf/checkstyle.xml                                               | 1 +
 src/main/java/org/apache/commons/exec/LogOutputStream.java            | 2 +-
 src/main/java/org/apache/commons/exec/PumpStreamHandler.java          | 2 +-
 .../java/org/apache/commons/exec/ShutdownHookProcessDestroyer.java    | 4 ++--
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/conf/checkstyle.xml b/src/conf/checkstyle.xml
index d9e1ed0..47b9952 100644
--- a/src/conf/checkstyle.xml
+++ b/src/conf/checkstyle.xml
@@ -55,6 +55,7 @@
 
     <module name="TreeWalker">
 
+        <module name="ExplicitInitializationCheck" />
         <property name="cacheFile" value="${checkstyle.cache.file}"/>
 
         <!-- Checks for Javadoc comments.                     -->
diff --git a/src/main/java/org/apache/commons/exec/LogOutputStream.java 
b/src/main/java/org/apache/commons/exec/LogOutputStream.java
index 0996df5..641ba08 100644
--- a/src/main/java/org/apache/commons/exec/LogOutputStream.java
+++ b/src/main/java/org/apache/commons/exec/LogOutputStream.java
@@ -53,7 +53,7 @@ public abstract class LogOutputStream
     /** the internal buffer */
     private final ByteArrayOutputStreamX buffer = new 
ByteArrayOutputStreamX(INTIAL_SIZE);
 
-    private boolean skip = false;
+    private boolean skip;
 
     private final int level;
 
diff --git a/src/main/java/org/apache/commons/exec/PumpStreamHandler.java 
b/src/main/java/org/apache/commons/exec/PumpStreamHandler.java
index 0d8bb80..4dd8276 100644
--- a/src/main/java/org/apache/commons/exec/PumpStreamHandler.java
+++ b/src/main/java/org/apache/commons/exec/PumpStreamHandler.java
@@ -51,7 +51,7 @@ public class PumpStreamHandler implements 
ExecuteStreamHandler {
     private long stopTimeout;
 
     /** the last exception being caught */
-    private IOException caught = null;
+    private IOException caught;
 
     /**
      * Construct a new <CODE>PumpStreamHandler</CODE>.
diff --git 
a/src/main/java/org/apache/commons/exec/ShutdownHookProcessDestroyer.java 
b/src/main/java/org/apache/commons/exec/ShutdownHookProcessDestroyer.java
index 736e8c7..5b31200 100644
--- a/src/main/java/org/apache/commons/exec/ShutdownHookProcessDestroyer.java
+++ b/src/main/java/org/apache/commons/exec/ShutdownHookProcessDestroyer.java
@@ -49,10 +49,10 @@ public class ShutdownHookProcessDestroyer implements 
ProcessDestroyer, Runnable
     private final Vector<Process> processes = new Vector<>();
 
     /** The thread registered at the JVM to execute the shutdown handler */
-    private ProcessDestroyerImpl destroyProcessThread = null;
+    private ProcessDestroyerImpl destroyProcessThread;
 
     /** Whether or not this ProcessDestroyer has been registered as a shutdown 
hook */
-    private boolean added = false;
+    private boolean added;
 
     /**
      * Whether or not this ProcessDestroyer is currently running as shutdown 
hook

Reply via email to