You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/12/29 15:12:36 UTC
(commons-compress) 08/08: Add Checkstyle ExplicitInitialization
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-compress.git
commit bfe32335af99b93085cefdf43bcb8047bd1302d1
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Dec 29 09:27:01 2024 -0500
Add Checkstyle ExplicitInitialization
---
src/conf/checkstyle/checkstyle.xml | 2 ++
.../org/apache/commons/compress/compressors/gzip/ExtraField.java | 2 +-
src/test/java/org/apache/commons/compress/archivers/zip/Lister.java | 5 +++--
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/conf/checkstyle/checkstyle.xml b/src/conf/checkstyle/checkstyle.xml
index 7943ce1fe..2f4c171be 100644
--- a/src/conf/checkstyle/checkstyle.xml
+++ b/src/conf/checkstyle/checkstyle.xml
@@ -54,6 +54,8 @@ limitations under the License.
<module name="EmptyBlock">
<property name="option" value="text" />
</module>
+ <!-- <module name="EqualsHashCode" /> -->
+ <module name="ExplicitInitializationCheck" />
<module name="FinalLocalVariable" />
<module name="IllegalImport" />
<module name="ImportOrder">
diff --git a/src/main/java/org/apache/commons/compress/compressors/gzip/ExtraField.java b/src/main/java/org/apache/commons/compress/compressors/gzip/ExtraField.java
index 4cbb3b532..fc3109ef6 100644
--- a/src/main/java/org/apache/commons/compress/compressors/gzip/ExtraField.java
+++ b/src/main/java/org/apache/commons/compress/compressors/gzip/ExtraField.java
@@ -142,7 +142,7 @@ public class ExtraField implements Iterable<SubField> {
private final List<SubField> subFields = new ArrayList<>();
- private int totalSize = 0;
+ private int totalSize;
/**
* Constructs a new instance.
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/Lister.java b/src/test/java/org/apache/commons/compress/archivers/zip/Lister.java
index e7e091dc0..78e31479c 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/Lister.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/Lister.java
@@ -41,10 +41,11 @@ import org.apache.commons.compress.archivers.ArchiveEntry;
public final class Lister {
private static final class CommandLine {
+
String archive;
- boolean useStream = false;
+ boolean useStream;
String encoding;
- boolean allowStoredEntriesWithDataDescriptor = false;
+ boolean allowStoredEntriesWithDataDescriptor;
Path dir;
}