From cbdf013a240ef5ce3306d25a364ca835fc1738ee Mon Sep 17 00:00:00 2001 From: Martin Wiesner Date: Sat, 7 Mar 2026 22:30:35 +0100 Subject: [PATCH 1/2] Fix typos in Javadoc and comments (#761) --- .../commons/compress/archivers/sevenz/SevenZFile.java | 2 +- .../compress/archivers/sevenz/SevenZFileOptions.java | 2 +- .../commons/compress/archivers/zip/StreamCompressor.java | 2 +- .../compress/archivers/zip/X5455_ExtendedTimestamp.java | 2 +- .../compressors/snappy/SnappyCompressorOutputStream.java | 6 +++--- .../compress/compressors/xz/XZCompressorInputStream.java | 6 +++--- .../compress/archivers/sevenz/SevenZHugeNextHeaderTest.java | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java index e4c2e809918..47c3162fbb6 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java @@ -311,7 +311,7 @@ public Builder setSeekableByteChannel(final SeekableByteChannel seekableByteChan /** * Sets whether {@link SevenZFile} will try to recover broken archives where the CRC of the file's metadata is 0. *

- * This special kind of broken archive is encountered when mutli volume archives are closed prematurely. If you enable this option SevenZFile will trust + * This special kind of broken archive is encountered when multi volume archives are closed prematurely. If you enable this option SevenZFile will trust * data that looks as if it could contain metadata of an archive and allocate big amounts of memory. It is strongly recommended to not enable this * option without setting {@link #setMaxMemoryLimitKb(int)} at the same time. *

diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFileOptions.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFileOptions.java index c59e29561c3..7737c39b13b 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFileOptions.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFileOptions.java @@ -72,7 +72,7 @@ public Builder withMaxMemoryLimitInKb(final int maxMemoryLimitKiB) { /** * Sets whether {@link SevenZFile} will try to recover broken archives where the CRC of the file's metadata is 0. *

- * This special kind of broken archive is encountered when mutli volume archives are closed prematurely. If you enable this option SevenZFile will trust + * This special kind of broken archive is encountered when multi volume archives are closed prematurely. If you enable this option SevenZFile will trust * data that looks as if it could contain metadata of an archive and allocate big amounts of memory. It is strongly recommended to not enable this * option without setting {@link #withMaxMemoryLimitInKb} at the same time. *

diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/StreamCompressor.java b/src/main/java/org/apache/commons/compress/archivers/zip/StreamCompressor.java index 4a497106b09..0b8c609dc70 100644 --- a/src/main/java/org/apache/commons/compress/archivers/zip/StreamCompressor.java +++ b/src/main/java/org/apache/commons/compress/archivers/zip/StreamCompressor.java @@ -279,7 +279,7 @@ void reset() { * @param b the byte array to write. * @param offset the start position to write from. * @param length the number of bytes to write. - * @param method the comrpession method to use. + * @param method the compression method to use. * @return the number of bytes written to the stream this time. * @throws IOException on error. */ diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestamp.java b/src/main/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestamp.java index 6971d5d761e..0f77ce5d5d9 100644 --- a/src/main/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestamp.java +++ b/src/main/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestamp.java @@ -500,7 +500,7 @@ private void reset() { /** *

- * Sets the acccess time as a {@link FileTime} of this ZIP entry. Supplied value is truncated to per-second precision (milliseconds zeroed-out). + * Sets the access time as a {@link FileTime} of this ZIP entry. Supplied value is truncated to per-second precision (milliseconds zeroed-out). *

*

* Note: the setters for flags and timestamps are decoupled. Even if the timestamp is not-null, it will only be written out if the corresponding bit in the diff --git a/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorOutputStream.java index ea03b7b17b1..163970e54a8 100644 --- a/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorOutputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorOutputStream.java @@ -39,7 +39,7 @@ * The raw Snappy format requires the uncompressed size to be written at the beginning of the stream using a varint representation, i.e. the number of bytes * needed to write the information is not known before the uncompressed size is known. We've chosen to make the uncompressedSize a parameter of the constructor * in favor of buffering the whole output until the size is known. When using the {@link FramedSnappyCompressorOutputStream} this limitation is taken care of by - * the warpping framing format. + * the wrapping framing format. *

* * @see Snappy compressed format description @@ -85,10 +85,10 @@ public class SnappyCompressorOutputStream extends CompressorOutputStream Date: Sat, 7 Mar 2026 17:40:20 -0500 Subject: [PATCH 2/2] Fix typos in Javadoc and comments #761 --- src/changes/changes.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 1394d09acee..b9cfca06b1f 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -136,6 +136,7 @@ The type attribute can be add,update,fix,remove. CPConstant subclasses are missing optional hashCode() and equals() to match its Comparable.compareTo(). CPUTF8 is missing optional hashCode() and equals() to match its Comparable.compareTo(). Pack200 class IcBands.IcTuple implements equals() but not hashCode(). + Fix typos in Javadoc and comments #761. Add MemoryLimitException.MemoryLimitException(long, long). Add CompressException.CompressException(String, Object...).