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-fileupload.git


The following commit(s) were added to refs/heads/master by this push:
     new c0734161 Don't initialize an instance or static variable to its 
default value
c0734161 is described below

commit c07341611c181dfdab71f09f2d0fe4143ff2c83b
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Oct 27 09:55:34 2023 -0400

    Don't initialize an instance or static variable to its default value
---
 .../org/apache/commons/fileupload2/core/ParameterParser.java | 12 ++++++------
 src/checkstyle/fileupload_checks.xml                         |  2 ++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/core/ParameterParser.java
 
b/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/core/ParameterParser.java
index 976c7124..a5846b2f 100644
--- 
a/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/core/ParameterParser.java
+++ 
b/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/core/ParameterParser.java
@@ -36,32 +36,32 @@ public class ParameterParser {
     /**
      * String to be parsed.
      */
-    private char[] chars = null;
+    private char[] chars;
 
     /**
      * Current position in the string.
      */
-    private int pos = 0;
+    private int pos;
 
     /**
      * Maximum position in the string.
      */
-    private int len = 0;
+    private int len;
 
     /**
      * Start of a token.
      */
-    private int i1 = 0;
+    private int i1;
 
     /**
      * End of a token.
      */
-    private int i2 = 0;
+    private int i2;
 
     /**
      * Whether names stored in the map should be converted to lower case.
      */
-    private boolean lowerCaseNames = false;
+    private boolean lowerCaseNames;
 
     /**
      * Default ParameterParser constructor.
diff --git a/src/checkstyle/fileupload_checks.xml 
b/src/checkstyle/fileupload_checks.xml
index c7405f26..28bfb745 100644
--- a/src/checkstyle/fileupload_checks.xml
+++ b/src/checkstyle/fileupload_checks.xml
@@ -91,6 +91,8 @@
 
   <module name="TreeWalker">
 
+    <module name="ExplicitInitializationCheck" />
+
     <module name="FinalLocalVariable">
       <property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF" />
       <property name="validateEnhancedForLoopVariable" value="true" />

Reply via email to